Advertisement
Guest User

Untitled

a guest
May 27th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. ' This is a form with 2 buttons, one to create the form and one to close the other form.
  2.  
  3. Public Class Form2
  4.  
  5. Public Class myForms
  6. Public Shared FirstForm As System.Windows.Forms.Form
  7. Public Shared SecondForm As System.Windows.Forms.Form
  8. End Class
  9.  
  10. Public Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  11. myForms.FirstForm = Me
  12. End Sub
  13.  
  14.  
  15. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  16. Dim myform4 As New Form4
  17. myform4.Show()
  18. myForms.SecondForm = myform4
  19. End Sub
  20.  
  21. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  22. myForms.SecondForm.Close()
  23. End Sub
  24. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement