Search code examples
c#visual-studiobutton

Create invisible clickable button


I've tried to create an invisible clickable button, but when I click it, nothing happens...

The code I used to make the button invisible:

button1.Visible = false;

I want to show a picture when the button is clicked (after it's been made invisible)


Solution

  • Try this instead of Invisible property:

    button1.FlatStyle = FlatStyle.Flat;
    button1.FlatAppearance.BorderColor = BackColor;
    button1.FlatAppearance.MouseOverBackColor = BackColor;
    button1.FlatAppearance.MouseDownBackColor = BackColor;