我有這個文本框,我只想輸入數字(。)包括在內。例如是190.5。if textbox has string then then msgbox but(。)does not count。 visual basic
但是如果它有例如190.5克文本,然後它會顯示MSGBOX(「錯誤」)
我有這樣的代碼,我發現某處
Dim allDigit = pbox.Text.Trim.Length <> 0 AndAlso _
pbox.Text.All(Function(chr) Char.IsDigit(chr))
If Not allDigit Then
MsgBox("Please input number only on price")
pbox.Clear()
Exit Sub
End If
如果我添加。在它顯示的msgbox的數量,所以無論如何包含。 ?
我不知道如何使用它。我剛剛從某處獲得了代碼,所以我不知道它是如何工作的。 – 2013-02-19 12:45:21
@BillyOtsuka - 增加了一個例子。 – 2013-02-19 12:49:56