在我的代碼,當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-職位);他們不應該故意包含在帖子中。 –