• Log in or sign up for an account here: https://www.sythe.org/login

how do i make it so...

damien121

Forum Addict
Joined
May 3, 2007
Sythe Gold
0
Messages
489
Location
Yanille =D
hello.
i have this thing on a program i made.
i have 5 text boxes.
and a cmd button
when you click the cmd button in action i made it says invalid username etc.
how would i make it so that if certainn things are in the boxes it does something else?
So say if certain things were in the boxes and they clicked the cmd button it would send a different message.
How? and thanks.
 
Code:
Private Sub Command1_Click()
If Text1.Text = "sythe" Then
MsgBox ("runescape 2 cheating")
End If

If Text1.Text = "runescape" Then
MsgBox ("a massive mmrpg")
End If

If Text1.Text = "cruels" Then
MsgBox ("www.creuls.net")
End If
End Sub
 
Remake of coveys to work without a control array
Code:
dim ctl as control
[INDENT]for each ctl in me.controls
[INDENT] if typeof(ctl) is TextBox then
[INDENT] if instr(1,ctl.text,"Covey lol") then
[INDENT] msgbox "Invalid string"
[/INDENT]end if 
[/INDENT] end if 
[/INDENT] next ctl
[/INDENT]
multiple if statements would be a good place to start, since you look like you are new to coding
 
Covey's code would be best if you only wanted to check certain textboxes.
Or you could set the Tag property of the textbox to something other than 0 and check for that within Jazz's loop.
But if you wanted to check all textboxes on the form, just use Jazz's.
 
Hmm i must refraise this or something.
i have 5 textboxes.
and a commandbox.
if 1 says hello
2 says okay
3 says dooby
4 says moms
5 says then
Then when they click the commandbox it sends a message to say hello, welcome to admin part.
Please understand as best you can. cos if it dont say them in the boxes i want it to say invalid shit

Please help you kind ppl :)
thanks
 
Hmm i must refraise this or something.
i have 5 textboxes.
and a commandbox.
if 1 says hello
2 says okay
3 says dooby
4 says moms
5 says then
Then when they click the commandbox it sends a message to say hello, welcome to admin part.
Please understand as best you can. cos if it dont say them in the boxes i want it to say invalid shit

Please help you kind ppl :)
thanks
Code:
Private Sub Command1_Click()
If Text1.Text = "says hello" Then
If Text2.Text = "okay" Then
If Text3.Text = "dooby" Then
If Text4.Text = "moms" Then
If Text5.Text = "then" Then
MsgBox ("welcome to admin part.")
End If
End If
End If
End If
End If
End Sub
 
nearly, that helped a bit but, i sorted it.
thanks guys!!!
 
Runescape Gamblingrunescape gambling
Back
Top