4
Answers

Please help me with this one!!!

Boblysan

Boblysan

20y
2.7k
1
I am trying to use the toolbar function in my application. I have found that whenever one of the toolbar buttons is clicked, all toolbar butten events get executed. I do realize that there is only a single click_event for all buttons on the toolbar, so what I have done is as follows... private void tbMainApp_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e) { if (e.Button == tbbEvent1) try { Event1 if (e.Button == tbbEvent2) try { Event2 if (e.Button == tbbEvent3) try { Event3 Given my apparent lack of knowledge, I am assuming that given each one of the buttons will be found on the toolbar, each will execute in succession. What should I do to ensure that when a button is clicked, ONLY THAT section of code gets executed. Any assistance you all could provide would be EXTREMELY appreciated. Thanks, Bob

Answers (4)