Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

button click call other button click 1

Status
Not open for further replies.

ajikoe

Programmer
Apr 16, 2004
71
0
0
ID
Hello,
I make two button :
button1 and button2

How can I make program inside button2 so when It is click it triggers button1 click event.

Sincerely Yours,
pujo
 
You call your button 1 event with null arguments

Code:
buton1_OnClick(object sender, System.EventArgs e)
{
}

buton2_OnClick(object sender, System.EventArgs e)
{
 buton1_OnClick(null,null);
}

________
George, M
Searches(faq333-4906),Carts(faq333-4911)
 
You could also simple manually control your InitializeComponent method (that is normally controlled by Visual Studio) and change

this.button2.Click += new System.EventHandler(this.button2_onclick);

to

this.button2.Click += new System.EventHandler(this.button1_onclick);


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top