![](/img/trans.png)
[英]In VB.NET how do I get a textbox to only allow one decimal point, < 3NUMBERS before it, and only 1NUMBER after it?
[英]Textbox should allow only Integer. not decimal in vb.net
我想在vb.net的文本框中只允許使用整個值,而不能使用十進制。 誰能幫助我如何檢查這一點。
只允許數字輸入:
Private Sub TextBoxKeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox.KeyPress
e.Handled = True
If IsNumeric(e.KeyChar) Then e.Handled = False
End Sub
有關更詳細的示例: http : //msdn.microsoft.com/zh-cn/library/ms229644(v=vs.80).aspx
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.