Click to See Complete Forum and Search --> : [RESOLVED] login form problem 2


YMCORP
February 15th, 2008, 01:12 PM
here is the code i am using:
Public Class LoginForm1


Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
If Me.UsernameTextBox.Text = "" And Me.PasswordTextBox.Text = "" Then

Dim form As New Form

Form1.Show()

Me.Hide()

Else

MsgBox("Could not verify your identity. Invalid username or password.")

PasswordTextBox.Text = ""

UsernameTextBox.Text = ""

UsernameTextBox.Select()

End If




Me.Close()

End Sub

Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
Me.Close()
End Sub

Private Sub LoginForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub UsernameLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UsernameLabel.Click

End Sub

after correct info is entered it doesnt load form1. any help? thankyou

WoF
February 15th, 2008, 01:15 PM
Well you say Dim Form as New Form and then Form1.Show?
Sounds wrong to me.
Try Form.Show, this is the object you have initialized.

YMCORP
February 15th, 2008, 01:22 PM
it still does not bring me to form1 after information has been entered:(

dglienna
February 15th, 2008, 02:11 PM
Take out the me.close and it works.

YMCORP
February 16th, 2008, 07:19 AM
thankyou that works great.