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
1825
Calling a Button tool click event in code?
posted

Good morning,

have a toolbarmanager object on my form.

Has two buttons in a group. When I click on one I want to be able to call the other buttons click event within code.

I have:

Dim objBtn As Infragistics.Win.UltraWinToolbars.ButtonTool
objBtn = uwTBMgr.Ribbon.Tabs("Home").Groups("Search Orders").Tools("Search")
Dim objE As Infragistics.Win.UltraWinToolbars.ToolClickEventArgs
uwTBMgr_ToolClick(objBtn, objE)

How do I setup the ToolClickEventArgs object for the 2nd parameter?

thanks

Deasun

 

  • 2077
    Offline posted

    It is not recommended to do what you are trying to do.

    Instead you should create a new sub (or function) with the code of the second toolbar button's event handler.The new sub is now available to be called from both toolbar buttons' event handlers.

    As a good practice, the event handlers should be called only when the event is raised. The common code should be in it's on sub or function.

    Hope this helps,

    Emanuel

  • 71886
    Offline posted

    Hello tirnaog,

    I prepared a sample for your scenario. Please review it and see if it fits your requirements.

    Please do not hesitate to ask if something comes up, I will be glad to help.

    FiringAnotherToolClickProgrammatically.zip
  • 1825
    posted

    Anybody ? :)