Private Sub txtDepositMny_KeyPress(KeyAscii As Integer) 'check只能输入数字键和回车 Select Case KeyAscii Case vbKey0 To vbKey9, vbKeyDecimal, vbKeyDelete, vbKeyBack, vbKeyF1 To vbKeyF12 程序要写在这里的
Case vbKeyReturn Me.txtDepositMny.Text = Format(Me.txtDepositMny.Text, "#0.00") SendKeys "{Tab}" KeyAscii = 0 Case Else KeyAscii = 0 End Select
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer) If UCase(Chr(KeyAscii)) = "H" Then KeyAscii = 0 Text1.Text = Text1.Text & "00" Text1.SelStart = Len(Text1.Text) End If End Sub
'check只能输入数字键和回车
Select Case KeyAscii
Case vbKey0 To vbKey9, vbKeyDecimal, vbKeyDelete, vbKeyBack, vbKeyF1 To vbKeyF12
程序要写在这里的
Case vbKeyReturn
Me.txtDepositMny.Text = Format(Me.txtDepositMny.Text, "#0.00")
SendKeys "{Tab}"
KeyAscii = 0
Case Else
KeyAscii = 0
End Select
End Sub
If UCase(Chr(KeyAscii)) = "H" Then
KeyAscii = 0
Text1.Text = Text1.Text & "00"
Text1.SelStart = Len(Text1.Text)
End If
End Sub