try this:
vb Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim msg As String = "" msg &= If(ListBox1.Items.Count = 0, "Listbox1, ", "") msg &= If(TextBox2.Text = "", "TextBox2, ", "") msg &= If(TextBox3.Text = "", "TextBox3, ", "") msg &= If(TextBox4.Text = "", "TextBox4, ", "") msg &= If(TextBox5.Text = "", "TextBox5, ", "") If msg <> "" Then MsgBox(msg & " need to be completed", MsgBoxStyle.OkOnly Or MsgBoxStyle.Information, My.Application.Info.Title) End Sub




Reply With Quote