先判断是否为数字和:
在你的判断的基础上加
Private Sub Text_KeyPress(KeyAscii As Integer)
If Not ((KeyAscii > 47 And KeyAscii <= 58 ) Then
KeyAscii = 0
End If
end sub
在你的判断的基础上加
Private Sub Text_KeyPress(KeyAscii As Integer)
If Not ((KeyAscii > 47 And KeyAscii <= 58 ) Then
KeyAscii = 0
End If
end sub
If Not ((KeyAscii > 47 And KeyAscii <= 58 ) Then
KeyAscii = 0
End If
end sub
这段代码不好使,我试了
选部件,再Microsoft Windows Common Controls-2 6.0(SP3)DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "hh:mm"
DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "hh:mm"