I’ve not already checked it on Mac, but at least on Windows PopUpMenu event “Change” should be called something else like “Clicked”.
Because if you click on the same raw that it’s displayed (nothing has changed) the “Change” event is fired.
Is it the way it is supposed to work?
We have already other events: KeyDown/Up and MouseDown/Up to know if we have clicked the PopUpMenu. So I would prefer that “Change” would mean “change”.
What do you think about it?
Think popupmenu on Mac versus Windows is slightly different in look and feel and behavior.
I use it quite a lot in Windows projects, since it looks like a combobox and the user can work with it without touching his mouse, by just typing the first character to select the item. The behavior you want needs to be coded only once if you subclass this control or have it in a containercontrol together with label etc.
on Mac it is the same behavior. But you can handle this.
You could create a property as integer. Name it for example p_LastIndex and in the Change-Event of the PopUpMenu do this code:
If me.ListIndex = p_LastIndex then
'do nothing cause nothing changed
MsgBox "Somthing has changed"
p_LastIndex = me.ListIndex
Thanks Joost and Wolfgang.
In fact I know how to handle this behaviour.
But I think that it is not correct that the event “Change” fires when nothing has changed. That’s it.
Is this still expected behavior?
Is this expected behavior on Linux?