winforms – Visual Studio 2017 – cant find Visual C++ Windows Forms – Tech Help Notes

winforms – Visual Studio 2017 – cant find Visual C++ Windows Forms

Ok, I found a working way to creating Windows Forms in Visual Studio 2017.

  1. Create new CLR Empty Project:

enter

  1. Add .cpp file for main function.

  2. In project add new item from UI->Windows Forms:

enter

(If we didnt add main loop before the error will occur)

  1. Now we can add new elements to form from the Toolbox to the left (i spent measurable time looking for that).

enter

  1. To run application we have to declare this instead of main function:

enter

Also we need to tell Visual Studio that we are making Windows Application instead of Console Application:

enter

WinForms designer support for C++/CLI was dropped a long time ago in VS 2012. MS suggests using C# for your WinForms code, and only use C++/CLI if you need to interop with native code.

And if you do end up using C++/CLI for interop, keep that layer as small as possible. Its a second-class citizen in the .NET world and isnt even mentioned in Microsofts recent post on their language strategy.

winforms – Visual Studio 2017 – cant find Visual C++ Windows Forms