aehimself 396 Posted August 29, 2019 Hello guys, I am developing a lightweight, customized SQL client. The main form only has a PageControl, all business logic reside on a frame. When the user chooses a connection, a new tabsheet is created, and a new instance of the said frame is placed upon it. Simple, and works like a charm. To please some people I decided to allow VLC styling of the application but this introduced a really strange issue. If the popup menu resides on the frame and has an image list assigned, it seems like that the menu is not drawn properly: If I change the Style back to the system default (or simply unassign the imagelist component from the TPopupMenu), everything works perfectly: Menu has no owner draw set. What I tried so far: - Add a new menu item during runtime to force a refresh of the menu - Unassign and reassign the popup menu during runtime from the DBGrid component - Unassign and reassign the image list during runtime - Set all ImageIndexes to -1, even removed all menu items during design time - Added Vcl.Styles to the uses clause of the frame - Changing Style during runtime has no effect. If I change back to System default, popup menu start being drawn correctly - Behavior is the same on additional modal forms, menu is not drawn correctly if image list is assigned In the mean time, the popup menu on the main form works perfectly. Which is even more strange, if I assign the main forms popup menu to the DB grid during runtime, it is drawn correctly. I feel like this will be something to do with the menus not being a child of the main form, or like a special hook I'm missing (like how you are forcing styling on a SynEdit component) but I could be far from the truth. I'm running out of ideas. Did anyone face this issue already? Any tips which I could try to make this to work? Thanks all! Share this post Link to post
Uwe Raabe 2057 Posted August 29, 2019 Looks like this issue: Bug In popupMenu with VCL Style - fixed in 10.3.2 Share this post Link to post
aehimself 396 Posted August 29, 2019 Uwe, Wow, a 3 year old bug... and indeed it does look the same! So without upgrading my Delphi installation I have no other choice than to forcefully remove icons when using Styles. Or not to use Styles in general 🙂 Thank you for the quick reply! Share this post Link to post
David Heffernan 2345 Posted August 30, 2019 (edited) 9 hours ago, aehimself said: Or not to use Styles in general The most reliable way to avoid the legion of bugs with this feature Edited August 30, 2019 by David Heffernan 1 Share this post Link to post
Sherlock 663 Posted August 30, 2019 6 hours ago, David Heffernan said: The most reliable way to avoid the legion of bugs with this feature And the most reliable way to concentrate on creating the best product with a "no need to learn how to use" UI. 1 Share this post Link to post
Uwe Raabe 2057 Posted August 30, 2019 Unfortunately some companies insist on having their corporate styling being reflected in their applications. Just because some colors are different from the Windows standard doesn't mean that one needs to learn how to use that UI. That is more related to uncommon handling of TAB vw. ENTER keys or the misuse of well known shortcuts. Share this post Link to post