You must Sign In to post a response.
  • Category: Windows

    If image is disabled then it should be displayed in click event and vice versa without conditons

    Hi Everyone,

    Good day!

    I need to display the image if its disabled and disable if its enabled while clicking the button.But no if conditions used.How to do that.Please help me out.

    Thanks in advance
  • #769437
    Hi Sharmila,

    You can try this ,

    private void button1_Click(object sender, EventArgs e)
    //For Enable /disable
    pictureBox1.Enabled = !pictureBox1.Enabled;

    //For show / hide
    pictureBox1.Visible = !pictureBox1.Visible;


  • Sign In to post your comments