Monday, 26 August 2013

Display picture only if textbox is blank

Display picture only if textbox is blank

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.

No comments:

Post a Comment