大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
input type="text" maxlength="11" /这是控制最大输入字数至于不能少于11个字,需要在点击保存按钮时,通过.length来控制
创新互联公司是一家专注于成都网站设计、成都网站制作、外贸网站建设与策划设计,合浦网站建设哪家好?创新互联公司做网站,专注于网站建设十载,网设计领域的专业建站公司;建站业务涵盖:合浦等地区。合浦做网站价格咨询:18980820575
以下是只能输入数字和小数点,并且小数点只能输入一次
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Textbox1.KeyPress
If Char.IsDigit(e.KeyChar) or e.KeyChar = Chr(8) or e.KeyChar = "." Then
If e.KeyChar = "." And InStr(TextBox1.Text, ".") 0 Then
e.Handled = True
Else
e.Handled = False
End If
Else
e.Handled = True
End If
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Dim s As String = TextBox1.Text
If Not ((Mid(s, Len(s), 1) = "0" And Mid(s, Len(s), 1) = "9") Or (Mid(s, Len(s), 1) = "A" And Mid(s, Len(s), 1) = "Z")) Then
s = Microsoft.VisualBasic.Left(s, Len(s) - 1)
TextBox1.Text = s
TextBox1.SelectionStart = Len(TextBox1.Text)
End If
End Sub