web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Disable a button on vi...
Power Apps
Unanswered

Disable a button on visibility of a rectangle

(0) ShareShare
ReportReport
Posted on by 91

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....

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    On the Displaymode of the Button:

    If(RectangleIcon.Visible,DisplayMode.Edit,DisplayMode.Disabled)
     
    Or
    If(RectangleIcon.Visible,DisplayMode.Disabled,DisplayMode.Edit)
    ------------

    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.
  • JasonAlmeida Profile Picture
    96 on at

    Heyo,

     

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

     

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

     

    cheers

    Jason 

  • aswin12345 Profile Picture
    91 on at

    Hi @JasonAlmeida  and @eka24 

     

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

  • JasonAlmeida Profile Picture
    96 on at

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

  • aswin12345 Profile Picture
    91 on at

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

     

    app.JPG

  • JasonAlmeida Profile Picture
    96 on at

    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)

     

    49DmBcritw.png

  • aswin12345 Profile Picture
    91 on at

    Hi @JasonAlmeida 

     

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

  • JasonAlmeida Profile Picture
    96 on at

    Is this what you're looking for?

    rA67RETayC.gif

     

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

    Gallery:

    - '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: {}})

  • aswin12345 Profile Picture
    91 on at

    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

  • pablik01 Profile Picture
    on at


    I'm refreshing the topic.
    I have a button that takes me to the login screen. After successful login, three icons will appear. I would like the login button to be inactive when these icons are visible and active when they are not. I wrote something like this but it doesn't work

     

    If(Icon11.Visible;login_pole.DisplayMode.Disabled;login_pole.DisplayMode.Edit)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard