i used text boxes name as text_box_1,text_box_2,text_box_3,text_box_4 i need to check these text boxes one by one and if they are null the text box should hide, this is my code ,i tried to declare a variable text box name to do this but it doesn't work ,so can you help me with this
int i;
private void check()
{
for(i = 0; i < 4; i++)
{
if((text_box_+i).Text == "")
{
(Text_box_+i.Hide();
}
}
}
thanks to @Oztaco i solved it, this is the way that i wanted it thank you very much @Oztaco...
private void check()
{
TextBox[] textBoxes = new TextBox[10];
textBoxes[0] = a;
textBoxes[1] = b;
textBoxes[2] = c;
textBoxes[3] = d;
int i;
for (i = 0; i < 4; i++)
{
if(textBoxes[i].Text == "")
{
textBoxes[i].Hide();
}
}
}