A Amjad Dec 4, 2003 #1 How can I execute the code of a button control when another button is clicked? Amjad
J Jan Tielens Dec 4, 2003 #2 Just invoke the method that handles the click event of the other button: Button1_Click(Button2, EventArgs.Empty)
Just invoke the method that handles the click event of the other button: Button1_Click(Button2, EventArgs.Empty)
C Cor Dec 4, 2003 #3 Hi Amjad, Quit simple If you are in the clickeventButtonA Then clickeventButtonB(sender, e) That is all Cor
Hi Amjad, Quit simple If you are in the clickeventButtonA Then clickeventButtonB(sender, e) That is all Cor
H Herfried K. Wagner [MVP] Dec 4, 2003 #4 * "Amjad said: How can I execute the code of a button control when another button is clicked? Click to expand... \\\ btnFoo.PerformClick() ///
* "Amjad said: How can I execute the code of a button control when another button is clicked? Click to expand... \\\ btnFoo.PerformClick() ///
C Chris Dunaway Dec 10, 2003 #5 Just invoke the method that handles the click event of the other button: Button1_Click(Button2, EventArgs.Empty) Click to expand... Better would be Button1.PerformClick. Or better yet, move the code in Button1's handler to a separate sub so you can call that from both places.
Just invoke the method that handles the click event of the other button: Button1_Click(Button2, EventArgs.Empty) Click to expand... Better would be Button1.PerformClick. Or better yet, move the code in Button1's handler to a separate sub so you can call that from both places.