Posts Tagged ‘WinForm’


 

PrimalForms 2011: Spotlight on the TreeView Control – Part 1

Monday, November 14th, 2011 by David Corrales
The Spotlight on Controls series describes the controls, that is, the objects in the System.Windows.Forms namespace, so you can use them effectively when building GUI apps in PowerShell Studio and PrimalScript. Each post focuses on one control and lists its most important properties, methods, and events, including the default event that PowerShell Studio adds to your script when you double-click the control. The posts include many examples written in Windows PowerShell, so you can use them right away. Read more: Spotlight on Controls: Common properties and methods This two-part post describes the TreeView control. Part 1: TreeView Overview Part 2: TreeNode…   More »

Got Shrinkage?

Thursday, November 10th, 2011 by David Corrales
Is your form suffering from shrinkage? Nobody likes it when your form shrinks to sizes where you can no longer see any controls. How embarrassing! Well there is hope! Stop embarrassing shrinkage with our simple solution! With a single application you will impress instead of depress! The PrimalForms Solution: Click on your form in the designer and alter the MinimumSize property in the Property Pane. Yes, that’s right! You can specify the minimum size your form will shrink to. Enter the minimum width and height and you’re done! And no more shrinkage problems! But what if you have the opposite…   More »

PrimalForms 2011: Spotlight on the TabControl

Friday, October 28th, 2011 by David Corrales
The “Spotlight on Controls” series focuses on a single WinForms control in PrimalForms 2011 , 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 MaskedTextBox control. This time we will look at the TabControl control: TabControl [System.Windows.Forms.TabControl] Manages a related set of tab pages. Default Event: SelectedIndexChanged Why use a TabControl control? Use the TabControl when you wish to present a series of related controls that are separated into…   More »

PrimalForms 2011: Spotlight on the ImageList Control

Wednesday, October 19th, 2011 by David Corrales
The “Spotlight on Controls” series focuses on a single WinForms control in PrimalForms 2011 , 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 MaskedTextBox control. This time we will look at the ImageList control: ImageList [System.Windows.Forms.ImageList] Provides methods to manage a collection of Image objects. Default Event: N/A Why use the ImageList control? Use the ImageList to store a group of images that can be accessed by other…   More »

PrimalForms 2011: Spotlight on the MaskedTextBox Control

Tuesday, September 27th, 2011 by David Corrales
The “Spotlight on Controls” series focuses on a single WinForms control in PrimalForms 2011 , 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 ErrorProvider control. This time we will look at the MaskedTextBox control: MaskedTextBox Control [System.Windows.Forms.MaskedTextBox] Represents an enhanced text box control that supports a declarative syntax for accepting or rejecting user input. Default Event: MaskInputRejected Why use a MaskedTextBox control? Use the MaskedTextBox to distinguish between…   More »

PrimalForms 2011: Validating the Form – Part 4

Friday, September 23rd, 2011 by David Corrales
In Part 3 we discussed validating techniques. Now in the final part of this series we will discuss how to validate the form as a whole. How to Trigger Validation when the Form is Closing: If you have worked with validation in the past, you may have noticed that the unfocused controls do not trigger validation when the form closes. To get around the issue, you can explicitly tell the form to validate its child controls and react accordingly. A good place to trigger the validation is in the form’s FormClosing event:$form1_FormClosing=[System.Windows.Forms.FormClosingEventHandler]{ #Event Argument: $_ = [System.Windows.Forms.FormClosingEventArgs] #Validate only on…   More »

PrimalForms 2011: Validating the Form – Part 3

Wednesday, September 21st, 2011 by David Corrales
In Part 2 we discussed how to validate a control. Now we will cover some techniques that can be utilize for validation. Validating Techniques: Regular Expressions: For more complex validation, such as validating an email address, you may need to rely on Regular Expressions. Regular expressions are useful because it allows you to match complex data by providing formatting information. In addition, PowerShell has built in support for regular expressions in the form of the –match operator. Example use of a regular expression in PowerShell: "PowerShell" -match "shell" In this example we are matching any string that contains the word…   More »

PrimalForms 2011: Validating the Form – Part 2

Friday, September 9th, 2011 by David Corrales
In Part 1 we discussed the import events and properties that are needed for validation. Now we will discuss how to validate a control.  How do I validate a control? As it turns out, validating controls depends on what type of control and the format of the data you wish to validate. Typically you will be validating text that is provided by a TextBox, but it could also come from a ComboBox where the user can type their selection. As for validating the text, it can range from simply ensuring there is value (i.e., not an empty string) or more…   More »

PrimalForms 2011: Validating the Form – Part 1

Friday, September 2nd, 2011 by David Corrales
A good user interface will validate user input to ensure it is in the correct format. This may come in the form of simply checking if there is an entry for a field, such as a name or a more complex task such as validating an email address. Thankfully WinForms has built in mechanisms to help facilitate data validation. Each control has the following events and properties that are used to validate a form: Validation Events: Validating This event occurs when the control is validating. Validation on a control is triggered when the control loses focus. Use this event to…   More »

PrimalForms 2011: Spotlight on the ErrorProvider Control

Thursday, August 18th, 2011 by David Corrales
The “Spotlight on Controls” series focuses on a single WinForms control in PrimalForms 2011 , 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 Timer control. This time we will look at the ErrorProvider control: ErrorProvider Control [System.Windows.Forms.ErrorProvider] Provides a user interface for indicating that a control on a form has an error associated with it. Default Event: N/A Why use a ErrorProvider control? Use the ErrorProvider if you…   More »