Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Congrats to Bonnie Berent....2006 .NET/C# MVP
Message
From
12/10/2005 18:04:42
 
 
To
12/10/2005 13:00:10
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01058089
Message ID:
01058484
Views:
8
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 :
			// code here
			break;

		case (int)Buttons.DoThat:
			// code here
			break;

		case (int)Buttons.DoTheOther:
			// code here
			break;

		default :
			// code here
			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
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform