Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' This is a form with 2 buttons, one to create the form and one to close the other form.
- Public Class Form2
- Public Class myForms
- Public Shared FirstForm As System.Windows.Forms.Form
- Public Shared SecondForm As System.Windows.Forms.Form
- End Class
- Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- myForms.FirstForm = Me
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim myform4 As New Form4
- myform4.Show()
- myForms.SecondForm = myform4
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- myForms.SecondForm.Close()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement