PL-100 · Question #277
You design a canvas app that has multiple screens. Each screen will have multiple button controls. The button controls must all have the same background color. You must be able to change the color…
The correct answer is B. Update the Fill property to a variable created by using the Set function. To configure button controls with a uniform background color that can be changed centrally, update the Fill property of each button to a variable created by using the Set function.
Question
Options
- AUpdate the Fill property to a variable created by using the Navigate function.
- BUpdate the Fill property to a variable created by using the Set function.
- CSelect all the buttons while holding the Ctrl key, and then change the color property.
- DUse a background image property in place of setting a color property.
How the community answered
(27 responses)- A7% (2)
- B81% (22)
- C11% (3)
Why each option
To configure button controls with a uniform background color that can be changed centrally, update the Fill property of each button to a variable created by using the Set function.
The `Navigate` function is used for screen navigation and does not create or update variables for control properties.
By setting a global variable (e.g., `Set(MyButtonColor, Color.Blue)`) and then assigning `MyButtonColor` to the `Fill` property of all button controls, you can change the color from one central location where the variable is defined, and all buttons will update instantly.
Selecting all buttons and changing their color property would work for an initial setup, but it does not allow for changing the color from one location dynamically later.
Using a background image property would replace the color with an image and is an inefficient way to manage a simple color change from a single source.
Concept tested: Canvas app global variables and control properties
Source: https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/working-with-variables
Topics
Community Discussion
No community discussion yet for this question.