I apologize if I am missing something here, but it looks like there is a single event handler for all clicks on all tools for all ultratoolbars on a form. Is this right? So I place an UltraToolBarManager control on my form, add a menu bar and a toolbar, add some menus and buttons, and then I have a giant select case statement to handle the clicks inside the UltraToolBarManager.ToolClick event handler:
Select Case e.Tool.Key
Case "Save"
(etc...)
Please advise if there is something I am missing or if there is a way to set up single event handlers for the individual tools. I am using NetAdvantage 2007 vol 3.
Thanks,
Bob
Events handler can be set up to individual tools this way:
UltraToolbarManager.Toolbars["ToolbarKey"].Tools["ToolKey"].ToolClick or ToolDoubleClick or any other event available for a tool.
Just make sure you don't forget to set the Key value for the toolbars and the tools.
Hope it helps.Emanuel
No that doesn't work - at least not in vb.net. If you set up an event handler for a toolclick event, the only thing you can access is the events for the toolbar manager itself. For example this is NOT valid
Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs) Handles toolBarManager.Toolbars("toolBar").Tools("Save").ToolClick
The only way I figured out to set up individual event handlers was to create a reference to the individual tools in the code (using withevents) and then make the event handlers that way. You may have meant that in your post:
Protected WithEvents btnSave As ButtonTool = toolBarManager.Toolbars("toolBar").Tools("Save")
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs) Handles btnSave.ToolClick