Sometimes, I say things so many times that I start to believe them, even when I’m wrong. Here’s a correction of one of the details that I’ve gotten wrong repeatedly.
“You can only use the Properties pane on one object at time.” — me
Um, no.
The Properties pane in PowerShell Studio displays the properties and property values of an object, that is, one of the Windows Forms controls on the Designer pane. By default, it displays the properties of one object at a time.
To determine which object the Properties pane displays:
- In the Designer pane, click the object.
-or-
- In the Properties pane, use the menu at the top of the pane.
All true.
However, when you select multiple objects in the Designer pane, such as by using Shift+Click or Ctrl+Click, or by selecting multiple objects in the designer pane (“lasso-ing”), PowerShell Studio shows its smarts.
First , it indicates that more than one object is selected by not displaying the name of an object in the Properties pane menu. That’s your clue that it’s displaying properties of multiple objects.
Then, it displays only the properties that the selected objects have in common. When all selected objects have a property, that property is displayed; otherwise, it is omitted.
For example, when I select a Textbox and a Button, I see only the subset of common properties.
When all selected objects have the same value for a shared property, that property value is displayed; otherwise, the value is blank.
For example, in this image, I’ve selected two Textbox object. Because they both have an Anchor property, the Anchor property appears in the display. But, because they have different values for the Anchor property, no property value appears.
You can also change the property values of multiple objects at one time. For example, this GUI app has six Textbox objects. I can select all of them and then change their properties.
For example, I can change the value of the ReadOnly property to True and the value of the Anchor property to Top, Left, Right. The change affects all selected objects.
That’s not just efficient. It also helps me to keep the property values of similar objects uniform.
And, now I know that the Properties pane displays the properties of one object at a time, except when it doesn’t, and that’s when it really shines!
June Blender is a technology evangelist at SAPIEN Technologies, Inc. and a Windows PowerShell MVP. You can reach her at juneb@sapien.com or follow her on Twitter at @juneb_get_help.
#PowerShellStudio Properties pane handles multiple objects. Who knew? Not me, obviously. https://t.co/Fp605ozbQc @SAPIENTech
RT @juneb_get_help: #PowerShellStudio Properties pane handles multiple objects. Who knew? Not me, obviously. https://t.co/Fp605ozbQc @SAPIE…
RT @juneb_get_help: #PowerShellStudio Properties pane handles multiple objects. Who knew? Not me, obviously. https://t.co/Fp605ozbQc @SAPIE…
Good article June. You didn’t mention “lassoing” controls as a selection method. Many users do not realize that we can do that.
FYI – Background:
PowerShell Studio is based on the Visual Studio IDE. The IDE editors all support this standard Windows CUA standard of selecting and editing objects. The same behavior exists in Office products and in nearly all products build to the Windows CUA. This is one thing that has made Windows so popular with developers. Apple and all other platforms may have supported CUA but almost none had an API that supported the CUA so completely. Of course CUA was an IBM spec and has since been replaced at a per-vendor level however it and Microsoft had an impact on all systems UI.
See: https://en.wikipedia.org/wiki/IBM_Common_User_Access
Here is a more current set of principals aimed at Windows systems: https://msdn.microsoft.com/en-us/library/windows/desktop/ff728831(v=vs.85).aspx
Microsoft tools (VStudio) and applications all follow and implement the components needed to apply these principles. I have always found it useful to be aware of these principles and to understand how they are implemented in the code and IDEs/Apps.
RT @juneb_get_help: #PowerShellStudio Properties pane handles multiple objects. Who knew? Not me, obviously. https://t.co/Fp605ozbQc @SAPIE…