在我的代码,当TextBox3
没有任何价值,它必须显示在MsgBox
通知书TextBox1
消息框出现第二次
输入一个值,但是,当我运行它两次,在屏幕上出现的MsgBox
通知当它应该只显示一次。
这里是我的代码:
Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
If TextBox3.Text = Nothing Then
TextBox1.Clear()
MsgBox("Enter Number to Textbox1")
Else
Dim digit As Integer = CInt(TextBox3.Text)
If TextBox1.TextLength = digit Then
Dim fields() As String = ListBox1.Text.Split(";")
Dim idx As Integer = ListBox1.FindString(TextBox1.Text)
If idx <> -1 Then
ListBox1.SelectedIndex = idx
ListBox1.SelectedIndex.ToString(fields(0))
ListBox2.Items.Add(Now() + Space(1) + ListBox1.Text.Substring(0, 13))
PrintDocument1.Print()
Else
TextBox1.Clear()
End If
End If
End If
End Sub
您的问题有答案。请不要忘记提供帮助你的答案,并接受答案。 –
@ 3vts:未来,请不要**添加**无用的绒毛,如“感谢您的帮助”,“提前致谢”或“祝您有愉快的一天”。相反(如果已经编辑帖子)**删除**依照[政策](https://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed -from-职位);他们不应该故意包含在帖子中。 –