JetBrains Rider 2022.2 Help

Design Windows Forms

If your project includes Windows Forms, you can use JetBrains Rider's visual Windows Forms designer and also create new Windows Forms projects.

Create Windows Forms projects

You can create a new project in a new solution using File | New… or add a new project to the existing solution by right-clicking the solution or solution folder node in the Solution Explorer, and choosing Add | New Project.

Choose Desktop Application project template and then Desktop Application as the project type.

JetBrains Rider: project template for Windows Forms project

Create and edit Windows Forms

You can add Windows Forms items in any project which have a reference to System.Windows.Forms. To add a new Windows Form item, right-click the project in the Solution Explorer and choose Add. You will be then able to select one of the Windows Forms templates — Windows Form, User Control, or Component. Windows Forms items are displayed with the corresponding icons in the Solution Explorer tree:

JetBrains Rider: Windows Forms in Solution Explorer

When you double-click a Windows Form item, it opens in a new editor tab and additionally opens the Designer Toolbox window.

Switch between the designer and the source code

  • Press Shift+F7 to switch to the designer and F7 to view the source code.

  • Use the Designer and Code tabs at the bottom of the editor.

When working in the designer view, you can select the desired component in the Designer Toolbox and then without dragging it, draw a rectangle area on the canvas where the component should be added.

If you decide not to add the component that you clicked, click the Pointer item in the components view.

Edit components on the canvas

  • Select components with a single click.

  • Use its adorners to move and resize the selected components.

  • Use the property grid and the event list to manipulate available properties like Text, Items, and Fonts, and subscribe to available events.

  • Double-click the component to add the default event handler. For example, it will add the Click event handler for a button.

  • Use Ctrl+X, Ctrl+C, paste Ctrl+V shortcuts to cut, copy, and paste components within the canvas and also between multiple Windows Forms items.

JetBrains Rider: Windows Forms designer

By default, the Designer Toolbox window lists standard Windows Forms components. To add add custom components to the toolbox, click Manage Components and then select the desired components there. All components from Global Assembly Cache and installed NuGet packages will be available for selection automatically. To load component assemblies from disk, click Add Add in the left part of the dialog and pick the desired assembly.

JetBrains Rider: Manage controls available in the Windows Forms designer
Last modified: 17 March 2022