HI at all,
How can I fire the click event of a tool from the Ultratoolbar manually by code?I read something about a "perform default action" thing somewhere, but can't remember.I thought about one of the following ways:Toolbarsmanager.tools("button").performaction ... or ... eventmanager.event("click").activate()OR OTHERWISE Toolbarsmanager_Toolsclick(me, [set eventargs to buttontool])
But I don't find any way to do this.
On the second way I don't know how to set/create the eventargs manually to raise the toolsclick event properly.
Have anybody a solution for this?
Thanks
My recommendation is to encapsulate the functionality you want to occur on a particular tool click into its own method. You can then call this method from the ToolClick event of the WinToolbarsManager, or programmatically from any other location where you want to perform the same functionality.
For instance, say I want to have a "Save" tool that saves the current file I'm editing. I also want to have a "Save" button that, when clicked, does the same thing. I'd write a "SaveFile()" method, which I'd call from the ToolClick event when the Save tool is clicked, as well as from the button's Click event.
It's generally not advisable to try to manually "raise" events in this fashion. The only time where I've seen it useful to "raise" events in this way is when performing automated UI testing - and to my knowledge, what methods we have that allow raising these events are likely internal methods.
Vince,
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
Vince McDonald said: It's generally not advisable to try to manually "raise" events in this fashion. The only time where I've seen it useful to "raise" events in this way is when performing automated UI testing - and to my knowledge, what methods we have that allow raising these events are likely internal methods.
I want to simulate a tool click in my unit test. For some of Infragistics controls I have seen RaiseEVENT methods. Is there similar method for ToolClick.