如何限制輸入框在vb中的11個數值?我想讓一個人編輯一個電話號碼,但似乎與我目前的代碼有問題。如何限制輸入框爲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
https://stackoverflow.com/questions/20686928/input-box-limit- in-vb –
https://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.mask – Slai