1.输入的最大位数自己可以设置
2.对于第二个问题请使用如下代码试一试。
Private Declare Function ShowCaret Lib "user32.dll" Alias "ShowCaret" (ByVal hwnd As IntPtr) As Boolean
Private Declare Function HideCaret Lib "user32.dll" Alias "HideCaret" (ByVal hwnd As IntPtr) As Boolean
Private Sub Form1_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
If Me.ActiveControl IsNot Nothing AndAlso Me.ActiveControl.Name = GcNumber1.Name Then
If e.KeyCode = Keys.Tab Then
HideCaret(GcNumber1.Handle)
Else
ShowCaret(GcNumber1.Handle)
End If
End If
End Sub |