Posts Tagged ‘Controls’


 

PowerShell Studio: Initializing my GUI controls

Tuesday, August 5th, 2014 by David Corrales
If you are working with a GUI script within PowerShell Studio and find that you need to edit the exported script to modify the control’s initialization, then you are doing something wrong. Don’t get me wrong, modifying and initialization of control properties is not the issue; in fact that it part of writing a GUI. What I’m referring to is the part where you are editing the exported scripts. If you are editing the exported script: 1. You are creating an extra step which means you need to export and modify the script anytime you make a change to the…   More »

PowerShell Studio: Ambient properties

Tuesday, January 7th, 2014 by David Corrales
In the PowerShell Studio: Enable and Disable Groups of Controls article we discussed how you can enable or disable group of controls by setting the parent control’s Enable property. Now we will look at other properties that have a similar trickle down effect, but work fundamentally in a different fashion. For example, if you change the font of the Form control, you may notice that all the controls within the form change their fonts accordingly. These trickle down properties are known as ambient properties. Ambient properties are properties that if not individually set, take their value from the parent control.…   More »

Spotlight on Controls: The Versatile Tag Property

Thursday, May 23rd, 2013 by David Corrales
You may not be aware that each WinForm Control has a Tag property which can be very useful in certain circumstances. Why use the Tag Property? Use the Tag property when you need to associate an object or store state information to a particular control. This ability to assign any object to the property, be it a control, value, psobject or scriptblock, is what makes the property so versatile. Below are examples demonstrating how the Tag property can be used in GUI scripts.   Example 1: The Tic Tac Plebius PowerShell game is a good example of how the Tag…   More »

PowerShell Studio: Enable and Disable Groups of Controls

Tuesday, February 12th, 2013 by David Corrales
If you follow the Spotlight on Controls series you might be familiar with the Enable property that is shared by all WinForms controls. This property allows you to disable controls so they no longer can be interacted with. For example, after pressing a button that triggers a Job, it is necessary to disable the button in order to prevent the user from pressing it again until the Job completes. Some instances might require you to disable a group of controls. In this case, your code may look like the following:$buttonAdd.Enable = $false $buttonRemove.Enable = $false $comboBoxOptions.Enable = $false This list…   More »

Spotlight on the StatusStrip Control

Wednesday, September 12th, 2012 by David Corrales
The “Spotlight on Controls” series focuses on a single WinForms control in PowerShell Studio 2012, details the important Properties, Methods, and Events of the control and demonstrates how to utilize the control. Most of the information about the controls is still applicable to previous versions of PrimalForms. Note: The StatusStrip control is only available for PowerShell Studio 2012 v3.0.6 or greater Last time we took a look at the StatusBar control. This time we will look at the StatusStrip control: StatusStrip[System.Windows.Forms.StatusStrip] Represents a Windows status bar control. Default Event: ItemClick Why use a StatusStrip control? Use the StatusStrip control, to…   More »

WinForms Interactive Reference Guide for PowerShell

Thursday, September 6th, 2012 by David Corrales
Not long ago we released the WinForms Control Reference for PowerShell. We have taken the Reference a step further by creating an interactive version! The Interactive Reference allows you to display help information by clicking on a control in the Toolbox: For those of you who like reading on paper, you have the option to print the reference page: Easy access to the Spotlight on Control Blog Articles using Help Menu:   How do I download the WinForms Interactive Reference? The WinForms Interactive Reference is available only to registered users. To download,  log onto your MySAPIEN account and click on…   More »

WinForms Control Reference for PowerShell

Tuesday, July 17th, 2012 by David Corrales
We are happy to release the “WinForms Control Reference for PowerShell” guide. This guide provides you with a quick reference for the WinForm controls in PowerShell Studio. The document contains a list of all the important properties, methods, and events that you should be familiar with when creating GUIs in PowerShell.   How can I get the reference guide? There are two ways to access the reference guide: 1. SAPIEN Document Explorer The guide will be included in the next service release of the SAPIEN Document Explorer (installed with PowerShell Studio). In addition, you will be able to access the…   More »

Spotlight on the StatusBar Control

Thursday, July 5th, 2012 by David Corrales
The “Spotlight on Controls” series focuses on a single WinForms control in PowerShell Studio 2012, details the important Properties, Methods, and Events of the control and demonstrates how to utilize the control. Most of the information about the controls is still applicable to previous versions of PrimalForms. Last time we took a look at the NotifyIcon control. This time we will look at the StatusBar control: StatusBar[System.Windows.Forms.StatusBar] Represents a Windows status bar control. Default Event: PanelClick Why use a StatusBar control? Use the StatusBar control, to display status information to the user. The StatusBar can also be used for user…   More »

PowerShell Studio: Creating Responsive Forms

Wednesday, May 16th, 2012 by David Corrales
When working with GUIs you may have noticed that the Form can freeze when running long scripts. Previously I discussed how to make your loops more responsive in this article, but not every long script comes in the form of a loop. If you truly want to make your forms responsive, you will need to move these slow scripts into another thread and in the PowerShell world this means using jobs. For those of you who aren’t familiar with PowerShell Jobs, they allow you to run scripts while freeing up the console to perform other tasks. In this case it…   More »

Spotlight on the NotifyIcon Control

Tuesday, May 8th, 2012 by David Corrales
The “Spotlight on Controls” series focuses on a single WinForms control in PowerShell Studio 2012, details the important Properties, Methods, and Events of the control and demonstrates how to utilize the control. Most of the information about the controls is still applicable to previous versions of PrimalForms. Last time we took a look at the ListView control. This time we will look at the NotifyIcon control: NotifyIcon [System.Windows.Forms.NotifyIcon] Specifies a component that creates an icon in the notification area of the Window’s taskbar. Default Event: MouseDoubleClick Why use a NotifyIcon control? Use the NotifyIcon control, to alert users of special…   More »