can any one help me to do this? i want to add to a ContextMenuStrip a tool of a UltraToolbarsManager, the text and the image is no a problem, but i cant add the event.
tnx
Dim miTool As Infragistics.Win.UltraWinToolbars.ToolBase = UltraToolbarsManager.Tools("any_key")
Dim mItem As ToolStripItem
mItem = ContextMenuStrip1.Items.Add(miTool.SharedProps.Caption, miTool.SharedProps.AppearancesSmall.Appearance.Image)
mItem.Enabled = tool.SharedProps.Enabled
'how to do this?
addhandler mItem.Click,addressof tool........
Use the ToolClick event of the WinToolbarsManager component in this circumstance. When handling this event, "e.Tool" will be the instance of the tool that was clicked to raise the event. In a typical implementation, you'd implement a "Select Case" statement (or "switch" in C#) to take different action based on the value of e.Tool.Key.
We recommend against directly handling the ToolClick event of the ToolBase instance itself.
tnx for your answer. in fact i actually do that. at this time a have the ToolClick event. i have the 'SELECT CASE' that you recommend me
----------------------------------------------------------------Select Case e.Tool.Key Case "btn_buscar" Dim frm As New busquedaPRODUCTO frm.MdiParent = Me frm.Show() e.Tool.SharedProps.Enabled = False Case "btn_costos" Dim frm As New costos frm.MdiParent = Me frm.Show()
.... and so on----------------------------------------------------------------
my application is finished, EXCEPT for one thing:
i need to add thes ribbon butons (all UltraToolbarsManager.Tools) to a windows.forms.ContextMenuStrip
i can add the image and the caption with this, (but i dont know how to add the event):
----------------------------------------------------------------Dim tool As Infragistics.Win.UltraWinToolbars.ToolBaseDim mItem As ToolStripItem
elMenu.Items.Clear()For Each str_key As String In llaves tool = utbm_toolbars.Tools(str_key) mItem = elMenu.Items.Add(tool.SharedProps.Caption, tool.SharedProps.AppearancesSmall.Appearance.Image) mItem.Enabled = tool.SharedProps.Enabled
'tool. 'AddHandler mItem.Click, AddressOf tool.ToolClickNext----------------------------------------------------------------
any idea?