Private Sub butApply_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles butApply.Click If tbStateID.Text = Nothing Then MsgBox("State I D is Required", MsgBoxStyle.Critical, "Error") cbStateID.Select() Return End If If tbSuburb.Text = "" Then MsgBox("Suburb is Required", MsgBoxStyle.Critical, "Error") tbSuburb.Select() Return End If Process the rest.... End Sub
Nitesh Luharuka http://www.niteshluharuka.com
Best, Sudheep.
private void button1_Click(object sender, EventArgs e) { if (textBox1.Text.Length == 0) { MessageBox.Show("Textbox1 should not be empty.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (textBox2.Text.Length == 0) { MessageBox.Show("Textbox3 should not be empty.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (textBox3.Text.Length == 0) { MessageBox.Show("Textbox3 should not be empty.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
Login to post response