| | |
enter key
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2002
Posts: 461
Reputation:
Solved Threads: 56
Try this:
VB.NET Syntax (Toggle Plain Text)
Private Sub TextBox1_Keydown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown, TextBox2.KeyDown If e.KeyCode = Keys.Tab Then If sender.Name = "TextBox1" Then TextBox2.Focus() e.Handled = True ElseIf sender.Name = "TextBox2" Then TextBox1.Focus() e.Handled = True End If End If End Sub Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress, TextBox2.KeyPress If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Return) Then If sender.name = "TextBox1" Then TextBox2.Focus() e.Handled = True ElseIf sender.name = "TextBox2" Then TextBox1.Focus() e.Handled = True End If End If End Sub
Last edited by waynespangler; Nov 9th, 2006 at 4:17 pm.
•
•
•
•
sorry but i didn't understand ;/ ,,
what i meant is using enter key to move from one text box to another..
and how I can do it..
I'm very new to programming. .
But using enter to do the same would be frowned upon.
*Voted best profile in the world*
![]() |
Similar Threads
- Capture the Enter Key in an Edit Control (C++)
- Problem with Keyboard Event <Enter> Key (JavaScript / DHTML / AJAX)
- CAPS LOCK Key (Visual Basic 4 / 5 / 6)
- win98: had no product key now can't uninstall (Windows 95 / 98 / Me)
Other Threads in the VB.NET Forum
- Previous Thread: System Usage Administration - Internet cafe management
- Next Thread: Compare 2 Tables - Return Rows VB 2008
Views: 19757 | Replies: 12
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2008 access advanced application array basic beginner browser button buttons center checkbox class client code combo convert cuesent data database datagrid datagridview date datetimepicker design designer dissertation dissertations dissertationtopic eclipse excel fade filter forms generatetags gridview html images input internet lib listview map mobile monitor net number objects open panel pdf picturebox picturebox2 port position print printing problem read remove richtextbox save searchvb.net select serial settings shutdown socket sorting sqlserver studio survey temperature textbox timer timespan transparency txttoxmlconverter user usercontol validation vb vb.net vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web webbrowser winforms winsock wpf wrapingcode year







