PopUpMenu

Hello,

A ListBox exists with some lines that have data in it.
When selecting an item in the ListBox I open a PopUpMenu that is populated with the necessary values to choose, and with the ListIndex property of the PopUpMenu I set the default value for the PopUpmenu to the value known in the ListBox.
Setting the value of the PopUpMenu with ListIndex makes run the PopUpMenu.Change event.

Is there a simple way to not run the popUpMenu.Change event when setting the PoUpMenu.listindex ?
It should only change when the value has really changed.

It could be done by code, but I was wondering if there is a more simple solution perhaps.

Thanks
Regards
Etienne

I disable the listbox

Then add the data.
Then enable the listbox

In the Changed event, I wrap the code with

[code]
if me.enabled then
//only do things if enabled

end if[/code]

https://forum.xojo.com/46824-selecting-popupmenu-initial-value-means-double-change-event-fir/p1#

Thanks for the replys.
The last link from Julia helped me solve the problem.

Thanks
Regards
Etienne

Julia’s solution is a good one and it helped me write what I needed.