Requirements;
Visual Basic 6.0
A Brain
Index;
1. How to make a form Hide.
2. How to make Secret Codes.
3. How to use the Else function
4. How to make a clickable Combobox.
Tutorial;
1. How to make form Hide.
When you click a button and it take you to a different form and you want the form you just left disappear this is how you do it.
Double click your button, and enter this code before the Form?.Show.
For Example
2. How to make Secret Codes.
You have to make it so people have a way to find out the codes first.
Make a Text Box and a Command Button.
Double click the command button and enter this code.
Code:
If Text1.Text = "Your Secret Code Here" Then
Form?.Show
End If
If you want more than one Secret code for example 4 secret code then it would look like this
Code:
If Text1.Text = "Your Secret Code Here" Then
Form?.Show
If Text1.Text = "Your Secret Code Here" Then
Form?.Show
If Text1.Text = "Your Secret Code Here" Then
Form?.Show
If Text1.Text = "Your Secret Code Here" Then
Form?.Show
End If
3. How to use the Else function.
This go good with the Secret Code Function. If you want somebody top enter something and if they get it wrong they start over, type this code.
Code:
If Text1.Text = "What you want them to enter Here" Then
Me.Hide
Form?.Show
Else
Form?.show
End If
the Second Form?.Show Will be the place where you tell the person they got it wrong and they have to start over.
4. How to make a clickable Combobox
Make a Combobox.
Double click the Form. Not the Combobox.
Enter this code.
Code:
With Combo1
.Additem "Item you want to display"
End With
If you want more then one item
Code:
With Combo1
.Additem "Item you want to display"
.Additem "Item you want to display"
.Additem "Item you want to display"
.Additem "Item you want to display"
End With
Now Double Click the combobox.
At the top it should say, (YOU HAVE TO DO THIS PART FIRST!)
Private Sub Combo1_Change()
Change that to
Private Sub Combo1_Click()
Now Enter this code
Code:
If Combo1 = "Item you want to display" Then
Form?.Show
End If
For more than One,
Code:
If Combo1 = "Item you want to display" Then
Form?.Show
If Combo1 = "Item you want to display" Then
Form?.Show
If Combo1 = "Item you want to display" Then
Form?.Show
End If
For Example;
Form;
Code:
With Combo1
.Additem "Test"
.Additem "Test2"
End With
ComboBox,
Code:
If Combo1 = "Test" Then
Form2.Show
End If
If Combo1 = "Test2" Then
Form3.Show
End If
This can be very Tricky... If you have problems with the combobox message me.
Now test it.
I will be adding more soon!