Button_click

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I get a toolbar button to execute the code of another buttons click
method?

I am embarrased to ask but I cannot get it to work.

thanks
CM
 
so say if you have the below

this.button1.Click += new System.EventHandler(this.button1_Click);
private void button1_Click(object sender, EventArgs e)
{
// Some code executing..
}

and your toolbar button is called tb1
all you do is the below

this.tb1.Click += new System.EventHandler(this.button1_Click);

Also in VS, you can select a control like your toolbar button, see its
properties and switch to event view ( click the icon in property titlebar).
Now select click, and then click drop down arrow and select the appropriate
method.

HTH
VJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top