May 26, 2004 #1 ajikoe Programmer Joined Apr 16, 2004 Messages 71 Location 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
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
May 26, 2004 1 #2 shaddow Programmer Joined Mar 22, 2001 Messages 1,862 Location RO 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) Upvote 0 Downvote
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)
May 26, 2004 #3 philosinger MIS Joined Nov 21, 2000 Messages 26 Location US 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); Upvote 0 Downvote
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);