Perry,
You should have started another thread. <g>
Anyway, I simply use one ButtonClick EventHandler for every button in the ToolBar. I also use an Enum for all the buttons. So, something like this:
private void MyToolBar_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
{
int button = this.ToolBar.Buttons.IndexOf(e.Button);
switch (button)
{
case (int)Buttons.DoThis :
break;
case (int)Buttons.DoThat:
break;
case (int)Buttons.DoTheOther:
break;
default :
break;
}
}
~~Bonnie
>Here's a simple one to start you off. What are the options in C# for adding code for clicking on toolbar buttons. And what's the prefered method?
>
>>Hope y'all don't mind if I don't reply to each individual post. Too much bandwidth. <g>
>>
>>Thanks for all your good wishes!!!
>>
>>Let's see ... I already thanked Kevin, Fred and Einar. Now it's time to thank Cetin, John, Perry, Denis and Victor.
>>
>>John said:
>>
>>
>>Congrats. You deserve it for putting up with Kevin Goff, LOL<<>>
>>Ain't that the truth!!!! <g>
>>
>>Perry said:
>>
>>
>>Congrats. Almost time to make you work for your money. I would expect the questions to start rolling in from me in a couple weeks.<<>>
>>I'm ready and waiting!
>>
>>Victor said:
>>
>>
>>Speech!! Speech!!<<>>
>>Speeches?!? We don't need no steenking speeches!!! <g>
>>
>>Thanks again everyone.
>>
>>~~Bonnie