-
hi,
I am new to VB and I want to create a very simple programme which does the following..
When you type in a piece of text, a pop-up says something about what you entered e.g Say I typed in Hi, a pop-up would say hello. If i type in, booyakasha, a pop-up would say..... erm..
please help
-
mhh...
one way would be to use the select case function ;)
place a textbox and a commandbutton at you're form, and paste the following code into form1
Code:
Private Sub Command1_Click()
Select Case Text1.Text
Case "hi"
MsgBox "Hello"
Case "booyakasha"
MsgBox "...erm.."
Case "vb"
MsgBox "Visual Basic"
Case Else
MsgBox "=)"
End Select
End Sub
hope that helps...
taLON
-
thanks very much! I a have so much trouble with VB compaired to C++.
Maybe I should stick so my HTML and javas =(
-
if you put:
Option compare Text
as the first line in the declarations section of your form, the user can enter UPPER or lower case and the select statement will still evaluate correctly
-
cheers for the help,
there I have problems with the code as when I add extra cases, It won't see the others... is this because of the indenting or something?
[Edited by JonTaylor on 03-24-2000 at 05:31 AM]
-
case else should be the very last one
You haven't left it in half-way down by any chance??
-
no i'm not that silly =Þ
I have it exaclty like the one shown but i added some more, i shall post the code
O wait it appears to be working now, the I fiddles with the posistioning of the Cases...
cheers =)
[Edited by JonTaylor on 03-24-2000 at 05:56 AM]
-