button on form 2 effect menu's enable on form 1

mikerob283

Member
Joined
Feb 15, 2005
Messages
12
Programming Experience
Beginner
I don't think I'm quite grasping the concept of controlling form 1 from form 2 while both are open.

form 1 opens

form 2 opens as a show (login form)

form 1's menu is disabled til form 2 is verified and closed

it's not happening

VB.NET:
 form 1 : 
 
Sub Page_Load
	 Dim frmForm2 As New frmForm2
	 frmForm2.Show()
End Sub
 
form 2:
Sub Login_Click
	 If txtUsername.Text = "someone" AND txtPassword.Text = "something" then
		   Dim frmForm1 As New frmForm1
		   frmForm1.Menu.enabled = true
		   Me.Close()
	 Else
		   txtUsername.Text = ""
		   txtPassword.Text = ""
		   lblLoginStatus = "Invalid Username/Password"
	 End If
End Sub

the login is successful, but when form2 is closed and form1's menu.enable is set to true it doesn't ungrey. I'm assuming the form has to refresh?

It's possible I know it is... it's just the same as making a label on form change text but I still haven't gotten that to work either.
 
Back
Top