Hi,
how do you programtically click a button on a Toolbar ?
Thanks
Michael
Have you tried what was described at the top of the thread (creating a method to handle the button click logic and call it both from the UltraToolbarsManager.ToolClick event handler and the place where you need to invoke the click programmatically)? That is the best way to implement this.
I have the same problem
If tlbPulsanti.Tools.Exists(sTool) Then tlbTool = tlbPulsanti.Tools(sTool) If tlbTool.EnabledResolved Then If tlbTool.GetType Is GetType(ButtonTool) Then DirectCast(tlbTool , ButtonTool) ..... Click
I dont'know sTool value but i must invoke the click programmatically.In UltraGrid there is PerformAction(UltraGridAction)
Lorenzo
Hi Mike,
suppose to have a toolbar that composes itself at runtime and a specific place could be occupied by two (or more) different ButtonTools. In this case you can not know what code to execute, it depends on what ButtonTool has been used. So, please could you demonstrate me how to invoke the click programmatically?
Thanks in advance Gianni
Well you will probably want to change the value passed to the indexer of the Toolbars collection from 0 to a string with the key of your toolbar. Is that where you received the exception?