My Program: I have a textBox and a pictureBox (which contains an error picture, placed exactly next to textBox) in userControl in my program.
My Goal: I want to HIDE the picture in the pictureBox only if the user types text in the textBox. If the textBox is left blank, the image in the pictureBox should be shown.
I tried using errorProvider but I was totally lost because I am a newbie in C# Programming. There are many errorProvider examples online but all examples are using Form and I am trying to do it in UserControl. So, I thought I should try this method. Please can you help me with the code? Thanks for your help in advance.
ANSWER:
Sealz answer works! My program will be working offline. So, this one also works:
if (String.IsNullOrEmpty(textBox1.Text))
{
//Show Picture
pictureBox2.Visible = true;
}
else
{
//Hide Picture
pictureBox2.Visible = false;
}
Thanks everybody for looking at my question! You all are awesome. =)