Windows Forms Designer

The Windows Form Designer is only supported on Windows.

Opening the Designer

To open the designer, issue the PowerShell: Show Windows Forms Designer command in VS Code. You will want to have an active PS1 file selected as this will be the main file that the editor will use.

Working with the Designer

The designer is very much like the standard Visual Studio designer. The design surface on the left allows you to modify your form. You can resize and delete controls from the bottom.

On the right right it provides a toolbox with controls that can be selected and placed on the form. The add a new control, click the control you'd like to place and then click the design surface of where you would like to place the control.

Below the toolbox is the properties dialog. You can select a control and modify its properties within this control.

On the bottom of the designer is a status bar. It displays the file that is being modified by the designer. An asterisk will be shown when the form is modified.

Event Handlers

To implement an event handler, double click on the control you'd like to add the event handler to. It will automatically generate the event handler code in Visual Studio Code.

Event handlers can also be generated by clicking the event handler tab in the property pane.

Event handler pane

To create a new event handler, type the name of the handler in the text box next to the event handler. Once you press enter and then save the form, with Ctrl+s or the Save button, the event handler will be generated in the code file.