Hello,
I am using a control with Context menu which can be dropped down for the user to select a button tool to trigger some actions. I would like to react both to the Tool Click event occurring when the user clicks on a tool, and also to an event indicating the menu has closed without a Tool being clicked. The source control would take actions in response to this "cancel" event.
The ToolClose up event always occurs when the menu closes but it occurs before the Tool Click event. In this case, the source control doesn't know if the Tool Click event will follow and so doesn't know whether ToolClose means Cancel or ToolClick is following with a desired action.
Are there any other events, I can use. Mouse up will occur after Click, also Deactivate could be used but I can't find the Form/Control that get these events to trigger Cancel.Tool Close method based on the mouse position on or off the popup menu could be used if could find the menu rectangle.
Any ideas? Thanks,
Wendy
Further testing has shown I can trap the UIElement when the menu is first shown. After PopupMenu.ShowPopUp() ...
popupUIE = ultraToolbarsManager1.UIElementFromPoint(
Control.MousePosition)
This will trap the UIControlElement. With this element, in the ToolCloseUp event, I can check the LastElementEntered. If null, then no ToolClick will follow and user has clicked outside the menu area; if not null, then ToolClick will follow.
Regards,
Hello Wendy,
Maybe one possible approach to solve this task, could be if you inherite our UltraToolbarManager and add your own event. This event could fired in desired moment and indicate if the Tool is clicked or it is closed without clicked.
Let me know if you have any questions.