Adding a new button to a ToolStrip is quite easy and involves 2 parts. First you need only create the button and set any kind of properties you desire for it:
ToolStripButton newButton = new ToolStripButton("My New Button");
newButton.Click += new EventHandler(newButton_Click); //Setup event handling function (you would need to build this function on your own or have Intellisense make it for you)
newButton.Image = someImage; //if desired
And finally add it to the ToolStrip that will be it’s parent with the Add() method of the Items property:
toolStrip1.Items.Add(newButton);
Does this work for you
|