[quote=340171:@]Just had a little play around, I think Michel does it by calling:
PopupMenu1.TextSize = 50 (or whatever size he calculates to be the scaling factor to fit the size he needs)
in the open. That auto-sizes the control to fit the text and increases its overall size. It’s not the correct way of doing it, but its the Xojo way. If you change that in the IDE (using the gear on inspector) it doesnt even alter the size of the control correctly (bug) until you go back into the form, then the selectable area of the control isnt right (bug).
Call SendMessageW(PopupMenu1.Handle, CB_SETITEMHEIGHT, -1, 50)
That call should work, it does, to a fashion, but there’s a load of problems going on with the control not doing things correctly. Eg, I can size it correctly, and fire this at it:
Call SendMessageW(PopupMenu1.Handle, CB_SHOWDROPDOWN, 1, 0)
which opens the popup via code and works perfectly, but the second I click the popup with the mouse it breaks and resets the size of the control. There’s so many redundant or incorrectly placed calls going on. I’m actually amazed that anything works as it should to be honest.
The control needs a huge bug report, there’s so much wrong with it it’ll take me a long time to document and prove all the problems, which is why I’m not putting in bug reports at the moment, I just cant face putting the effort in at the moment for it to be forgotten about for 6-12 months and not fixed.[/quote]
It looks like if you set the height twice with SendMessageW that it becomes permanent. I see exactly what you mean when you say you set it but then as soon as you touch it, it reverts. But if you set it again, it stays. So there’s definitely something odd going on.
Also, maybe it’s the way the controls are in Windows itself but there are specific heights that the PopUpMenu can be set to. It doesn’t seem they are all that granular.