| | |
How to use SendKeys?
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Sep 2008
Posts: 27
Reputation:
Solved Threads: 0
My form's KeyPreview is set to True. I want to allow my users to use the Enter Key instead of just the Tab key. I have the following code in my form's KeyPress event:
It doesn't like vbkeyreturn, which I used in Visual Basic 6.0. I think I must be close to having it right. Your help is appreciated!
~ Sheryl
VB.NET Syntax (Toggle Plain Text)
Private Sub frmDesigner_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress If e.KeyChar = vbkeyreturn Then SendKeys.Send("{TAB}") End If End Sub
It doesn't like vbkeyreturn, which I used in Visual Basic 6.0. I think I must be close to having it right. Your help is appreciated!
~ Sheryl
•
•
Join Date: Oct 2008
Posts: 32
Reputation:
Solved Threads: 4
Hi,
Private Sub frmDesigner_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If Asc(e.KeyChar) = Keys.Enter Then
SendKeys.Send("{TAB}")
End If
End Sub
Private Sub frmDesigner_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If Asc(e.KeyChar) = Keys.Enter Then
SendKeys.Send("{TAB}")
End If
End Sub
•
•
Join Date: Dec 2009
Posts: 1
Reputation:
Solved Threads: 0
•
•
•
•
My form's KeyPreview is set to True. I want to allow my users to use the Enter Key instead of just the Tab key. I have the following code in my form's KeyPress event:
VB.NET Syntax (Toggle Plain Text)
Private Sub frmDesigner_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress If e.KeyChar = vbkeyreturn Then SendKeys.Send("{TAB}") End If End Sub
It doesn't like vbkeyreturn, which I used in Visual Basic 6.0. I think I must be close to having it right. Your help is appreciated!
~ Sheryl
Dim vbkeyreturn as char=chr(13)
![]() |
Similar Threads
- SendKeys - Help needed please (Visual Basic 4 / 5 / 6)
- SendKeys in C++ (C++)
- problem with Sendkeys (Visual Basic 4 / 5 / 6)
Other Threads in the VB.NET Forum
- Previous Thread: vb.net project titles
- Next Thread: Help: Video Playout Code - Reg.
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 30minutes 2005 2008 access application arithmetic array basic binary bing button buttons c# center check code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist error excel file-dialog folder ftp google hardcopy image images inline listview login math memory mobile ms navigate net networking opacity output peertopeervideostreaming picturebox picturebox1 plugin port print printing problem problemwithinstallation project reports" save savedialog searchbox serial server soap sorting sql string studio tcp text textbox timer toolbox trim updown upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio web wpf





