Showing results for 
Search instead for 
Did you mean: 
Helper II
Helper II

Disable a button on visibility of a rectangle

Hi All,


Can we disable a button if a rectangle is visible in a screen.


I have made a rectangle visible and invisible based on the values in a SharePoint list. Now I want to disable a button based on the visibility of the of the rectangle. Is this possible?


Please help....

Super User
Super User

On the Displaymode of the Button:


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Helper II
Helper II



Add a formula like this to the DisplayMode property of your button:


If(Rectangle1.Visible, DisplayMode.Edit,DisplayMode.Disabled)




Helper II
Helper II

Hi @JasonAlmeida  and @eka24 


These two formulas are working but its not working on buttons inside gallery.

can you post a screenshot to give us a better idea of what you're trying to achieve?

Hi @JasonAlmeida  please find the below screenshot. In this pic if the yellow rectangle is visible then the play button must be disabled.



Thanks! This provides a bit more context 🙂


I'm going to assume that presses/selects an item in the gallery, you want to disable the button?


If that's the case, you can use something like this for the DisplayMode property of the button:

If(Gallery2.Selected.Climb = ThisItem.Climb, DisplayMode.Disabled, Edit)



Hi @JasonAlmeida 


But after that when i click on pause button it should be back on edit mode

Is this what you're looking for? 



here's what i had to set to make this work:


- 'Default' property = DefaultSel


Play button:

- 'DisplayMode' property = If(DefaultSel.Name= ThisItem.Name, DisplayMode.Disabled, Edit)

- 'OnSelect' property = UpdateContext({DefaultSel:Gallery2.Selected})


Pause button:

- 'DisplayMode' property = If(DefaultSel.Name = ThisItem.Name, DisplayMode.Edit, Disabled)

- 'OnSelect' property = UpdateContext({DefaultSel: {}})

Hi @JasonAlmeida 


This is similar to what I want to achieve but when I click on the play button all the play buttons in the gallery must be disabled and when i click on pause all the play button must be active. Actually I have achieved that as well but my issue here is whenever the app is refreshed or if i add a new item all the buttons will be active even if i have clicked play

Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,262)