

Private Sub btnCreate_Click(sender,args)
'if user clicked on create button, that means he created account so we will tell application that account is created and write that info to my.settings
my.settings.setCreate = True
my.settings.Save
btnCreate.Visible = false
End Sub
Private Sub Form_Load(sender,args)
'if account is created, Create button will be invisible
if my.settings.setCreate = true then
btnCreate.visible = false
else
'else it will be visible
btnCreate.visible = true
end if
End sub

Private Sub Form_Load(sender, args)
if My.Settings.MyUser <> "" then
btnCreate.Visible = False
else
MsgBox("You have to create new account in order to use this application")
btnCreate.Visible = True
End If
End Sub
Private Sub btnCreate_Click(sender,args)
If Textbox1.Text <> "" Then
If textbox2.text <> "" then
my.settings.MyUser = textbox1.text
my.settings.MyPass = textbox2.text
my.settings.Save()
Else
msgbox("Password field is empty.",Critical,"Error")
End If
Else
msgbox("Username field is empty.",Critical,"Error")
End If
End Sub
Private Sub btnLogin_Click(sender,args)
if textbox1.text = my.settings.MyUser then
if textbox2.text = my.settings.MyPass then
msgbox("Login successful",Info,"Success")
'do events
else
msgbox("Password is incorrect.",Critical,"Error")
End If
Else
msgbox("Username is incorrect.",Critical,"Error")
End If
End Sub