Calling mdi form from login form
I have a login form with the code below:
Code:
Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
If txtuser.Text = "sky" And txtpass.Text = "123" Then
Dim f As MDIParent = Me.MdiParent
f.Show()
Me.Close()
'Me.Hide()
'MdiParent.Show()
Else
MsgBox("Incorrect user info")
txtuser.Focus()
End If
End Sub
When i run this code and click OK, i get an error at f.show which says'Object reference not set to an instance of an object.'
How do i go about it so that i can get a smooth login an access my MDI form?
Re: Calling mdi form from login form
You need to instantiate the MdiParent form...
Re: Calling mdi form from login form
The error still persists even with the change u have stated