P
Peter Proost
Hi group,
I want to verify if my problem also happens with other people,
place a radiobutton, two textboxes, and a button on a form then copy paste
this code run the prog and press enter on the button, then just click the
button and see the difference (where the focus ends)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles _ Button1.Click
If RadioButton1.Checked = False Then
TextBox1.Focus()
Exit Sub
End If
End Sub
Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) _ Handles TextBox1.KeyUp
If e.KeyCode = Keys.Enter Then
TextBox2.Focus()
End If
End Sub
I think this is expected behavior because the keyevent has to end somewhere
but because I call txt.focus and exit sub in the button_click event the
keyevent gets handled in the txt.keyup event but I don't want this to
happen. I want the same result as if I would click the button.
Greetz Peter
I want to verify if my problem also happens with other people,
place a radiobutton, two textboxes, and a button on a form then copy paste
this code run the prog and press enter on the button, then just click the
button and see the difference (where the focus ends)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles _ Button1.Click
If RadioButton1.Checked = False Then
TextBox1.Focus()
Exit Sub
End If
End Sub
Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) _ Handles TextBox1.KeyUp
If e.KeyCode = Keys.Enter Then
TextBox2.Focus()
End If
End Sub
I think this is expected behavior because the keyevent has to end somewhere
but because I call txt.focus and exit sub in the button_click event the
keyevent gets handled in the txt.keyup event but I don't want this to
happen. I want the same result as if I would click the button.
Greetz Peter