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
585
ComboBoxTool Event Handling
posted
I'm kind of new to this, so my question might be a simple one. I have a Winforms application with a Ribbon menu to which I've added a ComboBoxTool.  I have successfully populated the values of this ComboBoxTool and it displays as I want. 

Now I want to handle the event of a user selecting one of the values from the drop down list.  I've added a ToolClick event handler as such:

//Set the Event Handler for the combobox Tool
this.ultraToolbarsManager1.Ribbon.Tabs["Tab1"].Groups["Group1"].Tools["Tool1"].ToolClick += new ToolClickEventHandler(tool1_ToolClick);I have also created the  "tool1_ToolClick function" and set a break point in it. However, when I select a value from the drop down list of the ComboBoxTool, my function doesn't seem to be called.  I assume that I'm going about this the wrong way. Can you advise me as to how to capture this event and execute some code based on which value the user selected? Thanks so much, Steve

 

 

  • 44743
    posted

    Handle the ToolValueChanged event to get notified when a new value is selected from a combo box tool. The Tool on the event args will indicate the tool whose value has changed and the current Value of the tool will be the value that was just selected. However, you will need to cast the Tool to a ComboBoxTool before accessing the Value property.