Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '***Edit better to use Reg Keys!
- ' make bools = true, instead of "not" because they might already be true and will make them false by doing that.
- 'This will load [loginFORM.vb] before the main form unless you check the checkbox in [loginFORM.vb] telling it not too ever again
- 'This has no flicker of the main form, it is very smooth.
- '--------------In form 1-----------------
- '►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄TO DO:►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►◄►
- '► Create a Boolean setting and make sure it's initial value is false which is automatic.
- '► Make form1 property setting 'ShowInTaskBar' to 'FALSE' and form1 property setting 'WindowState' to 'MINIMIZED'
- '► Make another form to be the login and create checkbox on that form, in my example I call it [loginFORM.vb]
- '► ---------------------Put the follow somewhere inside the code of [form1.vb]--------------------------
- Private Sub Form1_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
- If Not My.Settings.showlogin Then
- Login.Show()
- Me.Hide()
- End If
- End Sub
- '---------------------------------------------------------------------------------------------------
- '► ---------------------Put the follow somewhere inside the code of [LoginFORM.vb]--------------------------
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If CheckBox1.CheckState = CheckState.Checked Then
- My.Settings.showlogin = Not My.Settings.showlogin
- End If
- Form1.ShowInTaskbar = True
- Form1.Show()
- Form1.WindowState = FormWindowState.Normal
- Me.Hide()
- End Sub
- Private Sub Login_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
- End
- End Sub
- '---------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement