【发布时间】:2017-06-16 13:33:50
【问题描述】:
如何在 vb 中将输入框限制为 11 个数值?我想让某人编辑电话号码,但我当前的代码似乎有问题。
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For Each x As ListViewItem In lvCustomers.Items
Dim contactEdit As String
If x.Checked Then
contactEdit = CInt(InputBox("Modify contact no."))
Do Until contactEdit.Count = 11
MessageBox.Show("Maximum numerical digits of 11")
Loop
x.SubItems(5).Text = contactEdit
x.Checked = False
End If
Next
End Sub
【问题讨论】: