cydia常见问题:VB TEXT 同 List 的问题

来源:百度文库 编辑:高校问答 时间:2024/04/29 10:00:45
VB在text要写什么代码,才可以让TEXT1.text只可以输入数字,不可以输入其他

List写什么代码,才可以把Listbox 清空

Private Sub Text1_KeyPress(KeyAscii As Integer)
If (Not (KeyAscii > 47 And KeyAscii < 58)) And KeyAscii <> 8 Then KeyAscii = 0
End Sub

List1.Clear

text1.text=trim(text1.text)
if isdate(text1.text) then
msgbox "输入的值不能为日期类型,请重新输入"
text1.selstart=0
text1.sellength=len(text.text)
text1.setfocus
end with

或者

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii < 48 Or KeyAscii > 57 Then
KeyAscii = 0
End If
End Sub