Posts Tagged ‘Winforms’


 

PowerShell Studio – Passing and Returning Values using Forms

Tuesday, October 1st, 2013 by David Corrales
Two frequent questions we get on the forums are: How do I pass a value to another form? How do I get the results from a form? In this article, we will answer these common questions in order to give you a better understanding about how to use projects with multiple forms.   Getting Started You will need to create a project with multiple forms in order to proceed. The Multi-Form Project template is a good starting point. At the end of this article there is a link to download a sample project that demonstrates how to use these techniques.…   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 »

PrimalForms 2011: Create an Awesome Fade In Form

Thursday, August 11th, 2011 by David Corrales
Did you ever want to make your forms a little more flashy? How about creating an Awesome Fade In Form? Yeah that’s right I said Awesome! [Start Deep Voice] Everybody loves it when their forms make a smooth entrance. Ohhh Yeahhh… As opposed to the typical abrupt “here I am” way. But then again, whatever floats your boat baby. [End Deep voice] With few simple steps your form will be styling into existence. Steps to make your Awesome Fade in Form: Step 1: Use the Alpha Luke! Well it’s actually called Opacity, but essentially the same as alpha or transparency.…   More »

Spotlight on Controls: Common Properties and Methods

Wednesday, June 1st, 2011 by David Corrales
The Spotlight on Controls series is designed to teach beginning GUI developers about controls, the WinForms (System.Windows.Forms) objects that you use in a GUI application. Each article feature a different WinForms control and introduces its most frequently used properties, methods, and events. Unlike the MSDN reference pages, the examples are written in Windows PowerShell, so you can use them in your scripts. This post introduces properties that are common to many WinForms controls. Common Properties Name Text Enabled Visible Dock Anchor Common Methods Focus Select   Name property: Specifies a name for the control Use the Name property to assign a meaningful…   More »

Designing Charts for PowerShell

Thursday, May 5th, 2011 by David Corrales
Recently a blog post titled Charting with PowerShell was brought to my attention. The blog article demonstrates how to create graphs in PowerShell using WinForms. After reading this article, I thought it would be much easier to have the option to visually design your charts instead of coding it by hand. Therefore in the last service release we added support for the Microsoft Chart Controls. Because the chart controls are not part of the core .NET Library, you need to download the library: Microsoft Chart Controls for Microsoft .NET 3.5 Framework Microsoft Chart Controls Documentation To demonstrate the chart control, I created two…   More »

Tic Tac Plebius: A PowerShell Game

Tuesday, April 26th, 2011 by David Corrales
In order to celebrate the release of PrimalForms 2011, I’m releasing a game I created called: Tic Tac Plebius Just as the name suggests, the game is based on Tic Tac Toe, but with a SAPIEN twist. For those of you who are not familiar with Plebius, he is our beloved Super Scripting Monkey mascot. (Fig 1: Tic Tac Plebius PowerShell Game) Because I created the game using PrimalForms 2011, it means the underlining code is completely written in PowerShell. Tic Tac Plebius provides a good example on how to create a multi-form project and demonstrates advanced Windows Forms techniques.…   More »