Reputation: 11
me.settings isn't a part of form1
I have multiple forms, but my startup is my applications form not the login.
But here's my code for my login
Public Class Login
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = My.Settings.Username And TextBox2.Text = My.Settings.Password Then
MsgBox("Works!")
me.settings.Loggedin = true
Else
MsgBox("Missing Username or Password", MsgBoxStyle.Information, "Error")
End If
End Sub
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
CreateAccount.Show()
Me.Close()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
I don't understand what the problem is.
Upvotes: 0
Views: 49
Reputation:
So you want the LOGIN FORM to be loaded first... then if the username and password are matching, then the APPLICATION FORM will be loaded? If so, then you have to go to the project's properties and change the STARTUP FORM from your APPLICATION FORM's name into the LOGIN FORM's name.
Upvotes: 0
Reputation: 23974
The error message is informing you that the form called form1 does not have a property called Settings.
I believe you meant to say
My.Settings.Loggedin = true
instead of
me.settings.Loggedin = true
Upvotes: 3