TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
KY
NA
4
9.1k
How to add hot key function to my TextBox
Jun 24 2010 10:27 AM
Hey, everybody. I have a piece of VB code. What I want to do is to let the TextBox to accpet certain charaters. However, after I use the following code, the hot key like "Ctrl + V", "Ctrl + C", etc are no longer working. How can I modify the following code to let the Textbox support the hot keys from the Keyboard?
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Try
If Char.IsDigit(e.KeyChar) Or e.KeyChar = ". " Or e.KeyChar = Chr(8) Then
If e.KeyChar = ". " And InStr(Me.Text, ". ") > 0 Then
e.Handled = True
Else
e.Handled = False
End If
Else
e.Handled = True
End If
Catch ex As Exception
End Try
End Sub
Thank you very much in advance
Reply
Answers (
2
)
Problem in exporting grid view to excel file
How can i show Outlook Calendar in ASP.net application ?