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 forms(4) 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.forms(0) = Me
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Dim myform1 As New Form4
- myform1.Show()
- myForms.forms(1) = myform1
- Dim myform2 As New Form4
- myform2.Show()
- myForms.forms(2) = myform2
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- myForms.forms(1).Close()
- myForms.forms(2).Close()
- myForms.forms(1) = Nothing
- myForms.forms(2) = Nothing
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement