Developing Windows Forms Applications in Rider 2019.1

With Rider 2019.1 EAP (and the stable release coming very soon!), we deliver another major feature right to your front door. With nearly 300 votes, the Windows Forms Designer was one of the highest voted features that got implemented for this release. Since the designer relies on and integrates with Windows-specific components, it’s available only on Windows systems. We’re excited to tell you more about how it works, so let’s open up a Windows Forms project and dive right in!

Using the Windows Forms Designer

After opening (or creating) a Windows Forms project, we can open a form in the editor. This will show us the actual Designer View that displays the form or user control (1) we’re working with. From the Property Grid on the left-hand side (2), we can manipulate available properties like Text, Items, and Fonts, and we can also subscribe to events for double-clicks, mouse hovers and so on. On the right-hand side, the Designer Toolbox provides a list of components that can be added to the form (4). At the bottom, we can find navigation tabs to switch between the designer view and the code behind (3):

Designing Windows Forms

Besides framework controls, we can also add our own controls to the Designer Toolbox. After clicking on the Assembly List Configuration (1), we will find a dialog to browse for assemblies containing the controls (2). The selected controls are then listed in the Designer Toolbox list view as well (3):

Adding new controls to the toolbox

Creating related projects and files

Rider also ships with project and file templates related to Windows Forms development. When creating a new project, we can now also select the new Desktop Application project template, which further allows to select between UWP, Windows Forms, and WPF as the UI technology:

Project template for Windows Forms

When adding a new file, the list of templates will include the Windows Form, User Control and Component file template:

File templates for Windows Forms

Note that these templates will only appear in projects that have a reference added to System.Windows.Forms.

Error Handling when Forms are Broken

Things do not always go perfect, and if we have to manually edit our designer files, we might break our code. When loading a broken form, Rider will jump to the designer code and highlight the parts that couldn’t be parsed:

Error reporting for Windows Forms

One question that remains: does Rider support Windows Forms for .NET Core 3.0 preview? Not yet. We do have a tracking issue which you can subscribe to and/or add comments.

We hope this will make a lot of developers happier. As always, please don’t hesitate to give us some feedback! Is there anything we can further improve? Download Rider 2019.1 EAP now and let us know your thoughts!

About Matthias Koch

Matthias is a passionate C# developer and likes to talk about clean code, testing and tooling in general. Much of his spare time in the last years was devoted to his very own open source projects, including NUKE. He is working at JetBrains as developer advocate for the .NET department. Follow him on Twitter.
This entry was posted in How-To's and tagged , , . Bookmark the permalink.

22 Responses to Developing Windows Forms Applications in Rider 2019.1

  1. tony says:

    Will it work with third party controls? (ie, devexpress?)

  2. Jose Claros says:

    Please add Winforms desginer support for Linux.

    • Matthias Koch says:

      Hi, WinForms is a Windows-specific technology, so currently no plans for a designer on Linux/Mac.

      • SpiceyWolf says:

        As far as mono framework is concerned most winforms things will run fine on linux and mac… not 100% of it or all custom control techniques that would require hacky winAPI stuff sure… but the majority of stuff people would need could be done in it so I cant see a good reason why it shouldnt be done D:

        • Matthias Koch says:

          Sorry that was a bit unspecific. Rider uses the existing WinForms designer available for Windows, which is not compatible with other systems as is.

      • Steff says:

        Could you describe what that ‘Windows specific’ part about WinForms is? Because Mono has been able to run that stuff on Linux for years.

        • Matthias Koch says:

          Sorry that was a bit unspecific. Rider uses the existing WinForms designer available for Windows, which is not compatible with other systems as is.

      • eri0o says:

        Please consider adding Winforms support for Mac!

  3. Natalia Portillo says:

    Does it mean other frameworks can provide their designers as plugins made in C#?

    E.g.: https://github.com/picoe/Eto/issues/780

    • Matthias Koch says:

      In principle, many things can be achieved via plugins. However, this blog post doesn’t support that idea in particular. Can you elaborate maybe? You can also mention me in the GitHub issue if that helps (@matkoch).

  4. Taha Guler says:

    Is it possible to publish a Windows Form applications to an FTP server?

  5. Vasili says:

    Does it have TabControl component?

    • Matthias Koch says:

      It seems this was not added to the default list. We will fix this for 2019.1.2, which should be out in a few days. Thanks!

  6. Mateusz says:

    Hi,
    thank you for the Designer, this is great tool to have and is definitely making easier to decide to buy whole products bundle instead of some product + other famous IDE.

    However, one thing that I’m missing most at the moment is some easy and intuitive ability to access controls that are hidden by others, for example because of fill dock style.
    I think greatest solution, also for general experience when working with forms design, would be to implement some tree-like view in the structure window when in designer mode (as for now, structure window is empty in designer mode). For example main node will be a form or other base control, then children will be all controls attached to it etc. Some sorting possibilities that should be selectable:
    * by individual name
    * offset from top relative to parent, then offset from left
    * offset from left relative to parent, then offset from top
    * by control type
    Also in such tree could be provided some ohter properties of the control, and action handlers, so for example one could navigate through the form structure using this tree and then jump to the code of the function that is implementing some handler (maybe each node in the tree will contain some main virtual sub-nodes: “Children” and “Properties” etc, maybe “Children”, “Properties”, “Handlers”, etc.). Btw, I’m still missing Ctrl+F12 behavior like in PhpStorm, then the whole feature could be presented also there. Some quick, scaled down visual preview in floating window on mouse over tree element would be a nice bonus.

  7. Loser says:

    ListView is not found in the Designer Toolbox.

    Also, the Designer Toolbox needs to be auto-hided when switched to code editor, as it serves no purpose for the code editor.

  8. obe says:

    is there a keyboard shortcut for switching between the Designer and the code? I searched for “designer” in the Settings’ Keymap and nothing relevant came up…

  9. Gabre Francis says:

    Well, if this does not work i linux, why would i opt for jetbrains over visual studio

  10. Dmitry says:

    Great feature, but almost unusable in many cases without a Navigator or Tree view or some other hierarchical representation of the components in the form. There are hidden components and components that are pretty hard to select (e.g. SplitContainer)

Leave a Reply to Vasili Cancel reply

Your email address will not be published. Required fields are marked *