| | |
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
![]() |
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: Shrinking controls in vb.net 2005
- Next Thread: hi every body
| Thread Tools | Search this Thread |
"crystal .net .net2008 2008 access add advanced application array assignment basic beginner box browser button buttons center click code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationtopic dosconsolevb.net editvb.net employees excel exists firewall forms html images isnumericfuntioncall listview map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity open pan pdf picturebox picturebox2 port position print printpreview record regex reuse right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure temp textbox timer timespan transparency txttoxmlconverter useraccounts usercontol vb vb.net vb.nettoolboxvisualbasic2008sidebar vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web wpf wrapingcode xml year





