Hey heebiejeebies,
The question you ask: "In my current scenario, I need to get the currently selected value of a
PopupMenu" doesn't make sense to me, so I'll need a bit more clarification.
A component that as the concept of a selected item is usually something with the name List on it, like a
ListBox.
On a
ListBox there is a property called
ItemIndex that if it's value is different than -1, an Item of the List is selected.
It makes sense to maintain this selected state since selecting an item on a list is the first of any number of following actions.
To
select a menu is a single action concept that does not need to maintain state for any other action.
This concept does not translate into menus, because when you
select a menu item, it immediately fires the
OnClick event and that's it, there's no maintained state.
If you want to know what menu item was
selected, then you have two way:
- If it was called via an action, the action passed(Sender) onto the Execute has a property called ActionComponent that will give you access to the menu item that triggered the action
- If it was called via it's own OnClick event the Sender is the menu item itself.
So, it really begs the question: Why do you think that there should be a concept of a selected state after the action/event has been triggered?
Cheers,
Gus