Private Sub TextBox1_Enter(sender As Object, e As System.EventArgs) Handles TextBox1.Enter CheckBox1.BackColor = Color.Blue End Sub
Private Sub TextBox1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown Select Case e.KeyCode Case Keys.Enter, Keys.Down Call CheckBox1.Select() Case Keys.Up Call TextBox1.Select() End Select End Sub
Private Sub CheckBox1_Enter(sender As Object, e As System.EventArgs) Handles CheckBox1.Enter CheckBox1.BackColor = Color.Red End Sub
Private Sub CheckBox1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles CheckBox1.KeyDown '---- Keys.Enter時はイベント発生。Keys.Down、Keys.Up時にイベントが発生しない。 Select Case e.KeyCode Case Keys.Enter, Keys.Down Call TextBox2.Select() Case Keys.Up Call TextBox1.Select() End Select
End Sub
Private Sub TextBox2_Enter(sender As Object, e As System.EventArgs) Handles TextBox2.Enter CheckBox1.BackColor = Color.Blue End Sub
Private Sub TextBox2_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles TextBox2.KeyDown Select Case e.KeyCode Case Keys.Enter, Keys.Down Call TextBox1.Select() Case Keys.Up Call CheckBox1.Select() End Select End Sub