On Jan 14, 2006, at 10:57 AM, John McKernon wrote:

I have a pop-up menu that lists categories of things users can choose to view. Once they choose the category, a dialog window opens from which they can select specific items within that category, and after they've done that,
the dialog closes and the requested items are shown in a list.

My problem is, if the user selects the same category again (because they want to see different items), I don't get any action event from the popup menu because its value hasn't changed. In both Visual Basic and FutureBasic, I simply respond to a popup menu action event and get its value, but there
doesn't seem to be anything except the Change event in RB.

So the question is, how can I tell when a user has made a *repeat* selection
from a popup menu?

You could set ListIndex to -1 when your dialog closes. That will "clear" the popup of any selection, putting it back to an initial state. Now any selection, even a repeat, will fire the Change event. If you are using ShowModal for opening your dialog from your main window just do:

MyDialogWindow.ShowModal      // shows dialog
self.PopUpMenu1.ListIndex = -1  // executes when dialog closes or hides

If you are not using ShowModal, just put the following in the Close event of the dialog:

MyMainWindow.PopUpMenu1.ListIndex = -1 // be wary of implicit instantiaton




Or is there a better control for what I'm doing?


A listbox is certainly an option.


HTH,

Jack
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to