Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

vb.net not to accept comma, single quote and double quote

$
0
0

Hi !

I need to filter my all my textbox in my program to accept

all characters except for  comma, single quote, and double quote. (, ' ").

I use the keypress event for this filter. Here is my initial code but is not working.

If (e.KeyChar = Keys.OemQuotes) Then
        e.handled = false
    Else

   End If

In this, if they key entered is a quote then it will not allow.

Something like this and also to include keys.oemcomma.

I need to filter this to prevent error in my database query since comma and quotes are sensitive to it.

Any help is much appreciated!

Thanks,

Pem


Viewing all articles
Browse latest Browse all 21115

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>