I'm beginner studying for c#. If I have 2 textbox, can I validate 2 textbox in 1 if statement?
For example:
{
string emptytextbox
if (textBox1.Text == "" || textBox2.Text == "" || textBox3.text == "")
{
//if textbox2 is empty, then messagebox will show
emptytextbox = textBox2.text;
mbox(emptytextbox + " must be filled");
//messagebox will show "textBox2 must be filled"
//but if textbox1&2 has ben filled, but textbox3 empty,then messagebox will show "textbox3 must be filled"
}
}
Can I do this?
