PopUpMenu

  1. 3 months ago

    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

  2. Jeff T

    Jun 13 Midlands of England, Europe

    I disable the listbox

    Then add the data.
    Then enable the listbox

    In the Changed event, I wrap the code with

    if me.enabled then
    //only do things if enabled
    
    end if
  3. Julia T

    Jun 13 Sandy Hook, Connecticut

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

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

    Thanks
    Regards
    Etienne

  5. Arthur G

    Jun 16 Pre-Release Testers

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

or Sign Up to reply!