Jonathon Carr
October 7th, 2001, 01:38 PM
How can I stop certain symbols such as / \ : * ? < > | from being used in a text box?
Jonathon.
Jonathon.
|
Click to See Complete Forum and Search --> : Don't use symbols... Jonathon Carr October 7th, 2001, 01:38 PM How can I stop certain symbols such as / \ : * ? < > | from being used in a text box? Jonathon. John G Duffy October 7th, 2001, 03:16 PM Edit them out something like this private Sub Text1_KeyPress(KeyAscii as Integer) Dim NoWant as string NoWant = "/ \ : * ? < > " If NoWant Like "*" & Chr$(KeyAscii) & "*" then KeyAscii = 0 End Sub John G Clearcode October 8th, 2001, 04:47 AM You might want to remove the spaces from the string "NoWant"? ------------------------------------------------- Ex. Datis: Duncan Jones Merrion Computing Ltd http://www.merrioncomputing.com Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included. Cakkie October 8th, 2001, 07:07 AM Got a point there Tom Cannaerts slisse@planetinternet.be Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook John G Duffy October 8th, 2001, 07:28 AM Did not notice that. It appears to be a flaw in Cut and Paste because I cut and pasted that string directly from the original post which does not have the spaces. Will try it again to see what happens. John G John G Duffy October 8th, 2001, 07:31 AM I lied. The original post does have the spaces. John G Cakkie October 8th, 2001, 07:37 AM Yeahyeah, blame it on someone else ;) Tom Cannaerts slisse@planetinternet.be Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook Jonathon Carr October 8th, 2001, 01:14 PM Thanks John, Tried it, and it works perfecly, Jonathon. urs October 8th, 2001, 02:53 PM on keypress event u can check its keyascii suppose u want to cancel "a space" who's keyascii=32 if keyascii=32 then keyascii=0 end if or else if u dont know the keyascii then if(keyascii=asc("/")) then keyascii=0 end if best of luck codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |