|
-
Mar 23rd, 2000, 04:31 PM
#1
Thread Starter
Junior Member
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
-
Mar 23rd, 2000, 04:45 PM
#2
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
-
Mar 23rd, 2000, 04:50 PM
#3
Thread Starter
Junior Member
thanks very much! I a have so much trouble with VB compaired to C++.
Maybe I should stick so my HTML and javas =(
-
Mar 23rd, 2000, 04:52 PM
#4
Frenzied Member
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
-
Mar 23rd, 2000, 05:24 PM
#5
Thread Starter
Junior Member
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]
-
Mar 23rd, 2000, 05:49 PM
#6
Frenzied Member
case else should be the very last one
You haven't left it in half-way down by any chance??
-
Mar 23rd, 2000, 05:54 PM
#7
Thread Starter
Junior Member
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]
-
Mar 23rd, 2000, 05:55 PM
#8
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|