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 III
Super User III

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

PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!


Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (73,095)