开发者

In Lazarus, how to check whether a MenuItem has a Bitmap assigned?

开发者 https://www.devze.com 2022-12-20 07:37 出处:网络
I wrote some Lazarus code that loops through the menu items of the main menu and needs to see whether there\'s a bitmap assigned to each menu item.

I wrote some Lazarus code that loops through the menu items of the main menu and needs to see whether there's a bitmap assigned to each menu item.

I tried to check with

if Assigned (MenuItem.Bitmap) then...

but this always returns true, whether a bitmap is assigned or no开发者_JS百科t.

Guess the bitmap will be filled with an empty one if there's no actual image assigned.

So how to check whether the image is valid or empty?


ok, found it:

if not MenuItem.Bitmap.Empty then ...

:)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号