666- Beast
07-17-2008, 05:38 PM
Ok Today I'll teach you how to make a login screen with labels or a color changing textbox...
Color changing Text box login screen
__________________________________________________ __________________________________________________ ____________________________________
Needed:
2 Buttons
2 TextBoxes
1 Timer
Ok now when you make the 3 buttons rename them "OK," and "Cancel"
Ok first double click the cancel button and put this code:
End
Ok now second double click the first button "OK" and put this code
If TextBox1.Text = "Your Username here" And TextBox2.Text = "Your Password here" Then
Form2.Show
Then make a timer and put this code:
If TextBox1.Text = "Your Username here" Then
TextBox1.BackColor = Color.green
Else
TextBox1.BackColor = Color.Red
End If
If TextBox2.Text = "Your Password here" Then
TextBox2.BackColor = Color.green
Else
TextBox2.BackColor = Color.Red
End If
click on the timer go to properties and go to interval change to 1 then press Enabled = True
And there you go there is your simple login with changing textbox colors... :grin:
Changing Label text and color login screen
__________________________________________________ __________________________________________________ ____________________________________
Needed:
4 Labels
2 Buttons
1 timer
First name label 1 Username
Label 2 password
label 3 Incorrect Loggin
label 4 Incorrect Loggin
This is how it should look:
IMAGE 1
Then of course make the textboxes!
After that make the 2 Buttons "OK," and "Cancel"
Double click the "OK" button and type this:
If TextBox1.Text = "Your Username here" And TextBox2.Text = "Your Password Here" Then
Form2.Show
Then double click the cancel button and type this:
End
then double click Timer1 and put this code in it:
If TextBox1.Text = "Your Username here" Then
Label4.Text = "Correct Loggin"
Label4.ForeColor = Color.Green
End If
If TextBox2.Text = "Your Password here" Then
Label3.Text = "Correct Loggin"
Label3.ForeColor = Color.Green
End If
If TextBox1.Text = RandomNumerals Then
Label4.Text = "Incorrect Loggin"
Label4.ForeColor = Color.Red
End If
If TextBox2.Text = RandomNumerals Then
Label3.Text = "Incorrect Loggin"
Label3.ForeColor = Color.Red
End If
click on the timer go to properties and go to interval change to 1 then press Enabled = True
Then Inbetween
Public Class Form1 And
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Put this code:
Dim RandomNumerals As String
And there are both of your loggin screens! I hope you enjoy my TuT and learn from it as I have learned from many others! :D
PS..... I also posed this on warrock-hacks so don't be a noob and say I leeched.
Color changing Text box login screen
__________________________________________________ __________________________________________________ ____________________________________
Needed:
2 Buttons
2 TextBoxes
1 Timer
Ok now when you make the 3 buttons rename them "OK," and "Cancel"
Ok first double click the cancel button and put this code:
End
Ok now second double click the first button "OK" and put this code
If TextBox1.Text = "Your Username here" And TextBox2.Text = "Your Password here" Then
Form2.Show
Then make a timer and put this code:
If TextBox1.Text = "Your Username here" Then
TextBox1.BackColor = Color.green
Else
TextBox1.BackColor = Color.Red
End If
If TextBox2.Text = "Your Password here" Then
TextBox2.BackColor = Color.green
Else
TextBox2.BackColor = Color.Red
End If
click on the timer go to properties and go to interval change to 1 then press Enabled = True
And there you go there is your simple login with changing textbox colors... :grin:
Changing Label text and color login screen
__________________________________________________ __________________________________________________ ____________________________________
Needed:
4 Labels
2 Buttons
1 timer
First name label 1 Username
Label 2 password
label 3 Incorrect Loggin
label 4 Incorrect Loggin
This is how it should look:
IMAGE 1
Then of course make the textboxes!
After that make the 2 Buttons "OK," and "Cancel"
Double click the "OK" button and type this:
If TextBox1.Text = "Your Username here" And TextBox2.Text = "Your Password Here" Then
Form2.Show
Then double click the cancel button and type this:
End
then double click Timer1 and put this code in it:
If TextBox1.Text = "Your Username here" Then
Label4.Text = "Correct Loggin"
Label4.ForeColor = Color.Green
End If
If TextBox2.Text = "Your Password here" Then
Label3.Text = "Correct Loggin"
Label3.ForeColor = Color.Green
End If
If TextBox1.Text = RandomNumerals Then
Label4.Text = "Incorrect Loggin"
Label4.ForeColor = Color.Red
End If
If TextBox2.Text = RandomNumerals Then
Label3.Text = "Incorrect Loggin"
Label3.ForeColor = Color.Red
End If
click on the timer go to properties and go to interval change to 1 then press Enabled = True
Then Inbetween
Public Class Form1 And
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Put this code:
Dim RandomNumerals As String
And there are both of your loggin screens! I hope you enjoy my TuT and learn from it as I have learned from many others! :D
PS..... I also posed this on warrock-hacks so don't be a noob and say I leeched.