十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
input type="text" maxlength="11" /这是控制最大输入字数至于不能少于11个字,需要在点击保存按钮时,通过.length来控制
网站建设哪家好,找成都创新互联公司!专注于网页设计、网站建设、微信开发、微信小程序开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了永定免费建站欢迎大家使用!
以下是只能输入数字和小数点,并且小数点只能输入一次
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
Public Class Form Inherits System Windows Forms Form
#Region Windows 窗体设计器生成的代码
Public Sub New() MyBase New()
该调用是 Windows 窗体设计器所必需的 InitializeComponent()
在 InitializeComponent() 调用之后添加任何初始化
End Sub
窗体重写 dispose 以清理组件列表 Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (ponents Is Nothing) Then ponents Dispose() End If End If MyBase Dispose(disposing) End Sub
Windows 窗体设计器所必需的 Private ponents As System ComponentModel IContainer
注意: 以下过程是 Windows 窗体设计器所必需的 可以使用 Windows 窗体设计器修改此过程 不要使用代码编辑器修改它 Friend WithEvents TextBox As System Windows Forms TextBox Private Sub InitializeComponent() Me TextBox = New System Windows Forms TextBox Me SuspendLayout() TextBox Me TextBox Location = New System Drawing Point( ) Me TextBox Name = TextBox Me TextBox TabIndex = Me TextBox Text = Form Me AutoScaleBaseSize = New System Drawing Size( ) Me ClientSize = New System Drawing Size( ) Me Controls Add(Me TextBox ) Me Name = Form Me Text = Form Me ResumeLayout(False)
End Sub
#End Region Dim str As String =
lishixinzhi/Article/program/net/201311/13841