Loading…

Windows Forms Designer

The forms designer for PowerShell uses the standard Visual Studio forms designer. If you are familiar with the forms designer, you should be able to get up a running with PowerShell very easily. This document contains some basic information about the forms designer. For full Visual Studio documentation, please visit MSDN.

For a step by step guide on building a Windows Form, please see this blog post.

Adding a Form

  1. Select a PowerShell module or script project
  2. Click File
  3. Click New
  4. Click File
  5. Select the PowerShell Form item template
  6. Name the template what you would like
  7. Click ok

Modifying the Forms Design

  1. Open your project or solution in Visual Studio
  2. Double click your form in your project
  3. Add controls to your forms by dragging and dropping them from the toolbox window
  4. Edit properties of controls by selecting them and working with options in the properties window.
  5. Add event handlers by either using the properties window or by doubling the control to add the most common event handler.

Modify the Forms Code

  1. Open your project or solution in Visual Studio
  2. Right click on your form in your project and select View Code
  3. Edit code for event handlers or other functions

Debugging your Form

  1. Open your project or solution in Visual Studio
  2. Open the design or code view.
  3. Press F5 or click the Start button on the menu bar