|
-
Nov 12th, 2003, 06:16 AM
#1
Thread Starter
Fanatic Member
Content in a textbox [RESOLVED]
How do you find out if you got a certain phrase in a textbox regardless of what else you have in it?
Like, if the textbox contains 'save' anywherfe in it, so the string may be 'comon save for me pls' it will find the 'save' inside it and do whatever i want next?
Thanks, appreciated
Last edited by LITHIA; Nov 12th, 2003 at 03:40 PM.
-
Nov 12th, 2003, 06:22 AM
#2
VB Code:
InStr(Text1.Text, "save")
-
Nov 12th, 2003, 06:23 AM
#3
Junior Member
Try using something like this:
VB Code:
If InStr(1, Text1.Text,"Save") >0 then
'Events to happen here
End if
-
Nov 12th, 2003, 06:27 AM
#4
This will yield non case sensitive too 
VB Code:
If InStr(1, Text1.Text, "SaVe", vbTextCompare) <> 0 Then
'Item found
MsgBox "Match!"
End If
-
Nov 12th, 2003, 03:39 PM
#5
Thread Starter
Fanatic Member
hey thanks very much everybody! Works great, and the non case sensitive thing is handy - thanks
Resolved
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
|