tashiduks
Member
- Joined
- Apr 19, 2010
- Messages
- 22
- Programming Experience
- Beginner
Hi,
I have a Two Forms Created under one Class Library. My Project Looks Like that:
MyProjectClass (class Library)
- frmMain.vb
- frmLogin.vb
- Class1.vb
Now when i run first it loads the "frmLogin". After typing valid User Name and Password, it opens "frmMain". Till here its fine.
Now the problem is: when frmMain opens, the txtUserName.text value of frmLogin should display in frmMain Statusbar which is not happening. I have following Code:
frmLogin
Can anyone tell me why its not working? I am using VB.NET 2010 (VB Language)
Thanks
I have a Two Forms Created under one Class Library. My Project Looks Like that:
MyProjectClass (class Library)
- frmMain.vb
- frmLogin.vb
- Class1.vb
Now when i run first it loads the "frmLogin". After typing valid User Name and Password, it opens "frmMain". Till here its fine.
Now the problem is: when frmMain opens, the txtUserName.text value of frmLogin should display in frmMain Statusbar which is not happening. I have following Code:
frmLogin
VB.NET:
Private Sub btnOK_Click(sender As Object, e As System.EventArgs) Handles btnOK.Click
dim fMain as new frmMain
If Me.txtUserName.Text.Trim = "admin" And Me.txtPassword.Text.Trim = "123" Then
Me.Hide()
fMain.showdialog()
me.txtUserName.text = fMain.usernamestatusbar.text
else
MessageBox.Show("Invalid User Name or Password! Please try again. ", "Login Failed", MessageBoxButtons.OK, MessageBoxIcon.Error)
Me.txtUserName.Focus()
Me.txtPassword.Text = ""
End If
End Sub
Can anyone tell me why its not working? I am using VB.NET 2010 (VB Language)
Thanks