Menubar Icons are missing if I'm using imagekey instead of imageindex

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 6 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
monoeagle
Posts: 108
Last visit: Fri Jan 26, 2024 10:44 am

Menubar Icons are missing if I'm using imagekey instead of imageindex

Post by monoeagle »

Hi@All,

PSS 2017 last Patchlevel
W7 x64

Building a menubar with icon wasn't that difficult, imagelist, adding images, set the imageindex on the button voala.
Bildschirmfoto 2017-09-20 um 17.49.44.png
Bildschirmfoto 2017-09-20 um 17.49.44.png (20.66 KiB) Viewed 1737 times
But if I use imagekey instead the result is a button line without any icon.
Bildschirmfoto 2017-09-20 um 17.50.20.png
Bildschirmfoto 2017-09-20 um 17.50.20.png (11.75 KiB) Viewed 1737 times
I don't know if it is a bug or as designed?
Bildschirmfoto 2017-09-20 um 18.01.36.png
Bildschirmfoto 2017-09-20 um 18.01.36.png (45.95 KiB) Viewed 1737 times
In the imagekey place I can select the appropirate image as it should be, but with no result.

regards
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Menubar Icons are missing if I'm using imagekey instead of imageindex

Post by davidc »

You will need to use the ImageIndex, because of the way it serializes the binary data in the script, it is unable to retain that ImageKey information.
David
SAPIEN Technologies, Inc.
User avatar
monoeagle
Posts: 108
Last visit: Fri Jan 26, 2024 10:44 am

Re: Menubar Icons are missing if I'm using imagekey instead of imageindex

Post by monoeagle »

ok that sounds plausible

what is a scenario where I have to use imagekey?

if the files are physical on the hdd as files?
This topic is 6 years and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked