| | |
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: 19762 | Replies: 12
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.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 designer dissertation dissertations dissertationthesis dll dropdownlist error excel file-dialog folder ftp google hardcopy highlighting image images inline installer listview login 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 syntax tcp text textbox timer toolbox trim updown usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf







