Welcome to How to press a button from form1 ON form2! (Useful for settings etc.)
With some edit of the code you can have like this:
For this tutorial you need:
2Forms
2buttons
Some skillz ^^
Visual Basic 2008
---------------------
First we are going to make Form1!
1. Start VB
2. Create a app. and make 2 forms(form1 and form2)
3. Make 2 buttons ( 1 on form1 and 1 on form2)
Like this:
Form1
............
1. On button1 (Press button1 on form2) put this code:
Code:
My.Forms.Form2.Button1.PerformClick()
(That´s the magic code xP thanks me if you use it in your applications!)
2. On form1.load use this code:
Code:
form2.show()
form2.hide()
form2
........
1. On button1 (When this button is pressed then msgbox ( PRESSED)) put this code: ----------------------------------------
Debug it and press button1 on form1, it will press the button on form2..
End of tutorial!
(use this code to press/do something on form2 from form1 My.Forms.Form2.your_button_etc_here