Home > Software engineering >  how to hide a ImageButton in .NET MAUI
how to hide a ImageButton in .NET MAUI

Time:05-20

I want to make an ImageButton visible or invisible depending on a variable. More precisely, as soon as I click on a button it appears and as soon as I click again it disappears how can I do it?

thanks

CodePudding user response:

ImageButton inherits from the View class, thus it should have IsVisible property available. Try it out ? If this doesn't work, try button.Visibility=ViewStates.Gone or button.Visibility=ViewStates.Invisible

Gone will remove element from object tree completely

Invisible will just make it not visible (but still take place)

  • Related