[原创]请高手指教!
做一个计算器怎么才能在键盘上只输入1------9的数字和点,还有退格键
Private Sub Text1_KeyPress(KeyAscii As Integer) Select Case KeyAscii Case Asc("0") To Asc("9"), vbKeyBack '允许0~9数字和退格键
Case Asc(".") '允许一个小数点 If InStr(1, Text1.Text, ".") > 0 Then KeyAscii = 0 Case Else KeyAscii = 0 Beep '其他的发出Beep声音 End Select End Sub