Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
935
Find ActiveTool when user presses return
posted

Hello,

I have a toolbar manager with context menu tools dynamically generated based on the item under the mouse for right click. When the context menu has processed, I dispose these dynamically generated tools and associated tag data. Typically, when the popup menu closes I inspect the tools for an active tool, if no active tool, I dispose the tools in the ToolbarManager AfterToolCloseUp event else use the subsequent ToolClick event to clean up the tools.

If the user uses the arrow keys to move through the menu and then presses return, the CloseUp event fires with no ActiveTool on the menu. Then the ToolClick event fires. With the current implementation the tool click won't process as the required info has already been cleared.

I'm looking for some reliable trigger to use to remove the dynamically added tools. Is there a property or method that will detect whether a ToolClick event will follow the ToolCloseUp event? Or some way to know that the tool processing has finished?

Thanks for any suggestions,

Wendy