Skip to content

Make PictureBox invisible when I type text in a textBox

WILLIAM MARIASOOSAI

Asked Dec 22, 2012, 2:45 PM EST1 answer
Share
LinkedInX
Hi:

A simple Question. I am new to Visual C#.
I have a PicutreBox control visible on a form.
I have a textBox control  on the same form.
when I start entering the text in the textBox,
I want the PictureBox to disappear.

Could you please let me know how to do this.

Thanks for your help.
Regards,
bsoo

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    All:

    I was able to figure out. The following code works.
    -------------------------------------------------
    private void txtBox2_KeyDown(object sender, KeyEventArgs e)
    {
       if (pic1.Visible)
       {
          pic1.Visible = false;
       }
    }
    ----------------------------------------------

    Thanks & Regards

    bsoo.

    0