| View previous topic :: View next topic |
| Author |
Message |
SwedenS Cheater
Reputation: 0
Joined: 12 Dec 2007 Posts: 44
|
Posted: Thu Mar 20, 2008 2:06 am Post subject: HELP: HELP ME FAST |
|
|
Hi, i am coding a program, and i want a function thta if u translate some word right and click a button Form2 opens.
I know this code:
If txtWashington.Text = "George Washington" Then
frmGeorgeBush.Show
End If
But i want that if you type wrong thing in txtWashington.Text you gets a txtbox saying NOPE.
"
If txtWashington.Text = "George Washington" Then
frmGeorgeBush.Show
If Not TextBox "NOPE"
End If
"
Something like that, please whats the code?
|
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Thu Mar 20, 2008 2:11 am Post subject: |
|
|
uhhh... i'd try and help you, but what language are you talking about?
_________________
|
|
| Back to top |
|
 |
SwedenS Cheater
Reputation: 0
Joined: 12 Dec 2007 Posts: 44
|
Posted: Thu Mar 20, 2008 2:13 am Post subject: |
|
|
| Im talking about Visual Basic, isnt that visible enogh.!
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Thu Mar 20, 2008 2:41 am Post subject: |
|
|
| Code: | If txtWashington.text = "George Washington" then
frmGeorgeBush.Show
else
MsgBox("Something")
end if |
There's probably errors, having been doing VB for a while.
|
|
| Back to top |
|
 |
SwedenS Cheater
Reputation: 0
Joined: 12 Dec 2007 Posts: 44
|
Posted: Thu Mar 20, 2008 3:58 am Post subject: |
|
|
Thank you moller, testing it in school after the weekend and the easter.
Keep giving me samples of it.
|
|
| Back to top |
|
 |
Snootae Grandmaster Cheater
Reputation: 0
Joined: 16 Dec 2006 Posts: 969 Location: --->
|
Posted: Thu Mar 20, 2008 5:00 am Post subject: |
|
|
im fairly sure moller got it perfect, btw, what kind of program is this going to be for?
_________________
|
|
| Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Thu Mar 20, 2008 6:04 am Post subject: |
|
|
Moller's code is good.
Here's a couple of more complex ways to do this:
Using a select statement
| Code: |
Select Case txtWashington.Text
Case "George Washington":
frmGeorgeBush.Show
Case "King Kong":
frmKingKong.Show
Case Else:
MsgBox "You fail at life."
End Select |
Using multiple IF statements
| Code: | If txtWashington.Text = "George Washington" Then
frmGeorgeBush.Show
ElseIf txtWashington.Text = "Sonic" Then
frmSonic.Show
ElseIf txtWashington.Text = "Moo" Then
MsgBox "cow"
Else
MsgBox "Fail"
End If |
They could be helpful for future reference.
|
|
| Back to top |
|
 |
SwedenS Cheater
Reputation: 0
Joined: 12 Dec 2007 Posts: 44
|
Posted: Thu Mar 20, 2008 6:29 am Post subject: |
|
|
| Estx wrote: | Moller's code is good.
Here's a couple of more complex ways to do this:
Using a select statement
| Code: |
Select Case txtWashington.Text
Case "George Washington":
frmGeorgeBush.Show
Case "King Kong":
frmKingKong.Show
Case Else:
MsgBox "You fail at life."
End Select |
Using multiple IF statements
| Code: | If txtWashington.Text = "George Washington" Then
frmGeorgeBush.Show
ElseIf txtWashington.Text = "Sonic" Then
frmSonic.Show
ElseIf txtWashington.Text = "Moo" Then
MsgBox "cow"
Else
MsgBox "Fail"
End If |
They could be helpful for future reference. |
Thx, and i place the code in Command1 button? (Double click the button.)
|
|
| Back to top |
|
 |
Estx Expert Cheater
Reputation: 0
Joined: 04 Mar 2008 Posts: 172
|
Posted: Thu Mar 20, 2008 8:09 am Post subject: |
|
|
Yeah, inside any sub/function will work.
Just make sure you edit the code appropriately where needed.
|
|
| Back to top |
|
 |
SwedenS Cheater
Reputation: 0
Joined: 12 Dec 2007 Posts: 44
|
Posted: Sat Mar 22, 2008 4:45 am Post subject: |
|
|
THX, again, keep giving me samples of login..
Now, i need a login & register code/tutorial.
|
|
| Back to top |
|
 |
|