EasyMultiTagging: Change tag/untag icons during runtime

Hi All,

I have a question on EasyMultiTagging. I tried to ask support but I
would give it a shot here also.

EMT is working fine on the browses I use it for. But so far I am not
able to change the tag/untag icons during runtime. The idea is that
based on some choice the user makes the list box can be enabled or
disabled. When the list box is disabled I would like to replace the
tag/untag icons by “disabled icon” versions.

I tried to use this lines in ThisWindow.Reset():

IF UseBrowse = True
ENABLE(?MyBrowse)
MultiTag:9.SetStyleIcon(’~EMTmarkB.ico’,’~EMTblank.ico’,)
ELSE
DISABLE(?MyBrowse)

MultiTag:9.SetStyleIcon(’~EMTmarkB_Disabled.ico’,’~EMTblank_Disabled.ico’,)
END

Unfortunate that doesn’t work for the icons.

Has anybody an idea how I can do this?

The SetStyleIcon method is used only when the BrowseBox is initialized because it changes its structure: a place for the icon is allocated in the structure.

Your problem can be solved with the following code:

IF UseBrowse = True
           ?MyBrowse{PROP:IconList, EMT:ICONLIST_MARK} = '~EMTmarkB.ico'
           ?MyBrowse{PROP:IconList, EMT:ICONLIST_BLANK} = '~EMTblank.ico'
           ENABLE (?MyBrowse)
ELSE
           ?MyBrowse{PROP:IconList, EMT:ICONLIST_MARK} = '~EMTmarkB_Disabled.ico'
           ?MyBrowse{PROP:IconList, EMT:ICONLIST_BLANK} = '~EMTblank_Disabled.ico'
           DISABLE (?MyBrowse)
END

Hi Guennadi,

That solved the problem. Thank you. It is working fine now.
(For those who trying too: Remove the space between the ~ and the icon name).

1 Like

Koen, thank you for your feedback.

(btw, I edited my original replay re ~ )

FYI: the ~ in ‘~Yada.ico’ means that you are working with a compiled in resource instead of a file on disk

Icons that are declared inside of window structures are automatically compiled in as resources, but Icons that are just mentioned using property syntax are NOT automatically compiled in as resources, it’s up to you to do that.

See the Solution Explorer tree, inside of the project in question, highlight “Libraries, Objects and Resource Files” right click and select “add Library, Object or Resource Files(s)” in the file picking dialog change the file type to Icons, and select the Icon(s) to add

Yeah, I know that. I was just mentioning that there must not be a space like ‘~ Yada.ico’. That gives compile errors no matter if the icon is added as resource or not.