From Evernote: |
[VB.NET]テキストボックスで指定の桁数を入力したら次へフォーカス |
# Region " テキストボックス7桁でフォーカス移動"
Private Sub txtTEST_KeyPress( ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtTEST.KeyPress
Dim strBefore As String = Me .txtTEST.Text.Trim
If strBefore.Length = 6 AndAlso _
Asc(e.KeyChar) <> Keys.Back AndAlso _
e.KeyChar.ToString.Trim.Length = 1 AndAlso _
Me.txtEigen.SelectionStart = 6 Then
Me.txtNEXT.Select()
End If
End Sub
# End Region
0 件のコメント:
コメントを投稿