Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-09-03
2
Medium Priority
?
34 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 2000 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

715 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