Hi.
How would i do it in my code if i Want to use an "ENTER" key when transferring control?
thanks!
:afrog:
Printable View
Hi.
How would i do it in my code if i Want to use an "ENTER" key when transferring control?
thanks!
:afrog:
Hmm, not to sure what you mean, do you mean you push enter and the something moves? :/
Yes.
For example:
Textbox1 TextBox2 TextBox3.
After i input item on TextBox1 and I press ENTER, the control will go to TextBox2 and so on.
Thanks.:afrog:
Try adding a KeyPress event handler to each textbox to detect when Enter is pressed and set the focus to the next box.
Hi,
I think you mean that if you put some text in textbox1 the the carret goes to te next textbox2.
If so you could try something like this:
vb Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) _ Handles TextBox1.KeyPress, TextBox2.KeyPress, TextBox3.KeyPress If Not TextBox1.Text = "" Then If e.KeyChar = Chr(Keys.Enter) Then TextBox2.Focus() e.Handled = True End If End If If Not TextBox2.Text = "" Then If e.KeyChar = Chr(Keys.Enter) Then TextBox3.Focus() e.Handled = True End If End If If Not TextBox3.Text = "" Then If e.KeyChar = Chr(Keys.Enter) Then MsgBox("You filled all textboxes") e.Handled = True Else TextBox3.Focus() End If End If End Sub
Wkr,
sparrow1
Have a look here:
http://www.vbforums.com/showpost.php...19&postcount=6
Refer this