.NET core graphical solution

Thread Starter

Samantha Groves

Joined Nov 25, 2023
160
I am trying to create a Windows Forms App in C# by using .NET Core.

One thing I noticed is that if you use the .NET Core you cannot graphicaly change the Form (you cant drag controls over the Form and place them there), you have to write down code.

But is this the case , is there a version of .NET Core where you can graphicaly change the Windows Form?
 

ApacheKid

Joined Jan 12, 2015
1,762
I am trying to create a Windows Forms App in C# by using .NET Core.

One thing I noticed is that if you use the .NET Core you cannot graphicaly change the Form (you cant drag controls over the Form and place them there), you have to write down code.

But is this the case , is there a version of .NET Core where you can graphicaly change the Windows Form?
Hi.

Windows Forms is no supported by .Net Core. The .Net Core initiative strives to decouple as much of the ecosystem from specific platforms and Windows Forms is tightly coupled to Windows.

Now if you don't care about portability you can create a .Net Framework app either Forms or WPF and each has a visual editor for GUI elements.

In the project create dialog choose these options

1704139127267.png

You can then pick Forms or WPF as the basis for the app.

Does that help?
 

ApacheKid

Joined Jan 12, 2015
1,762
I am trying to create a Windows Forms App in C# by using .NET Core.

One thing I noticed is that if you use the .NET Core you cannot graphicaly change the Form (you cant drag controls over the Form and place them there), you have to write down code.

But is this the case , is there a version of .NET Core where you can graphicaly change the Windows Form?
GUI apps (other then web) can now also use MAUI this is similar to WPF in that the GUI tree of elements is represented as a hierarchy in XAML (a variant of XML). WPF does have a UI editor but MAUI does not and it seems this is not planned either.

MAUI is generic, not tied to Windows and is100% .Net Core
 

ApacheKid

Joined Jan 12, 2015
1,762
I am trying to create a Windows Forms App in C# by using .NET Core.

One thing I noticed is that if you use the .NET Core you cannot graphicaly change the Form (you cant drag controls over the Form and place them there), you have to write down code.

But is this the case , is there a version of .NET Core where you can graphicaly change the Windows Form?
WPF (now superceded by MAUI) was a huge step forward in GUI design technology. I used to work at Faithlife and their app (Logos) was coded entirely in WPF supporting impressive features like embedded pie charts, Hebrew/Greek text, ability to zoom in/out and reshape the app window with everything rearranging itself and auto sizing/scaling and lots more - very very very hard indeed to do with Forms. Unlike old Forms, WPF (and MAUI) has many advantages like resolution independence and a much better model of representing UI elements as a hierarchy where one can propagate events up/down the tree and set styling and fonts and colors etc completely separated from the UI logical tree - very good but initially a struggle if used to working only with Forms.

Because of the very elegant hierarchical design of the UI in WPF/MAUI one soon gets used to working directly in XAML, the need to "see what it looks like" is reduced compared to Win Forms and although it seems like a step back it isn't its just a change in how one's mind works.
 
Last edited:

Frank Bolleri

Joined Sep 23, 2023
77
Sorry if I'm replying to a thread that hasn't been around for so long.

I just wanted to mention that a good alternative might be .NET Core + Avalonia for the UI.

I haven't used it in any actual projects, but I've done some testing and I'd say you can even get a single shared codebase to then compile for both Windows and Mac, which seems like a great thing to me.

I had done some experiments in the same direction with MAUI but it didn't convince me too much... although I no longer remember exactly why... :rolleyes:
 
Top