Solved

Textbox key down event to check for number and letter and decimal

Posted on 2016-09-03
2
32 Views
Last Modified: 2016-09-05
Hello,
I have a function to do a check on keydown event of a textbox ,
how can I have it for only letters,numbers and decimal points
  Public Sub GenericTextBoxFilter(sender As Object, e As KeyEventArgs)
        If TypeOf sender Is RadTextBox Then
            Dim tb = DirectCast(sender, RadTextBox)
            MessageBox.Show(e.KeyValue.ToString())
            If (e.KeyValue.ToString()) = 192 Then
                e.SuppressKeyPress = True
                e.Handled = True
            End If
        End If
    End Sub

Open in new window

0
Comment
Question by:RIAS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 41783409
https://msdn.microsoft.com/en-us/library/system.windows.forms.control.keypress(v=vs.110).aspx

Use the KeyPressed event instead.  The link has example code
0
 

Author Closing Comment

by:RIAS
ID: 41784394
Thanks Andy as always!
0

Featured Post

Major Incident Management Communications

Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question