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):
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):
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:
When adding a new file, the list of templates will include the Windows Form, User Control and Component file template:
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:
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!
tony says:
April 29, 2019Will it work with third party controls? (ie, devexpress?)
Matthias Koch says:
May 2, 2019There are a couple of reported issues (https://youtrack.jetbrains.com/issue/RIDER-25262), but we also had feedback that everything works just fine. Guess it’s best to just try it out 🙂
Jose Claros says:
April 30, 2019Please add Winforms desginer support for Linux.
Matthias Koch says:
May 2, 2019Hi, WinForms is a Windows-specific technology, so currently no plans for a designer on Linux/Mac.
SpiceyWolf says:
June 21, 2019As 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:
October 28, 2019Sorry 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:
October 24, 2019Could 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:
October 28, 2019Sorry 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:
October 27, 2019Please consider adding Winforms support for Mac!
Natalia Portillo says:
May 1, 2019Does 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:
May 2, 2019In 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).
Taha Guler says:
May 22, 2019Is it possible to publish a Windows Form applications to an FTP server?
Matthias Koch says:
May 27, 2019I think you could follow up with this article: https://www.jetbrains.com/help/idea/uploading-and-downloading-files.html If there’s any further question, don’t hesitate to ask here again.
Vasili says:
May 26, 2019Does it have TabControl component?
Matthias Koch says:
May 27, 2019It 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!
Mateusz says:
June 25, 2019Hi,
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.
Loser says:
August 10, 2019ListView 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.
obe says:
October 6, 2019is 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…
Matthias Koch says:
October 7, 2019Hey, the action should be called Select Next Tab in multi-editor file.
Gabre Francis says:
October 20, 2019Well, if this does not work i linux, why would i opt for jetbrains over visual studio
Matthias Koch says:
October 28, 2019There is no Visual Studio for Linux, so I don’t really follow the question?
Dmitry says:
November 6, 2019Great 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)
soikot says:
April 18, 2020How can I deploy or publish this application and make an Installer file???
Md. Akter Hossain says:
May 14, 2020I’m using Rider version 2020.1 in my workstation.
My issues are, when I create any WinForms/WPS/UWP application and then build, it’s showing bellow errors:
(A) Microsoft.Common.CurrentVersion.targets(3032, 5): [MSB4216] Could not run the “GenerateResource” task because MSBuild could not create or connect to a task host with runtime “CLR4” and architecture “x86”. Please ensure that (1) the requested runtime and/or architecture are available on the machine, and (2) that the required executable “C:\Program Files\JetBrains\JetBrains Rider 2020.1.0\tools\MSBuild\Current\Bin\MSBuild.exe” exists and can be run.
(B) Microsoft.Common.CurrentVersion.targets(3054, 7): [MSB4028] The “GenerateResource” task’s outputs could not be retrieved from the “FilesWritten” parameter. Object does not match target type.
Also, its not showing any Components on Designer Toolbox. Moreover, when I try to Open Designer of a User Control, its tell “designer is outdated”
Jared says:
June 5, 2020We have old vb.net windows forms projects, does this work with VB.net or ONLY c#?