Questions in Windows Forms and C #

3

I'm trying to learn C # but I'm having a hard time understanding the file and folder hierarchy of Visual Studio 2013 Solution Explorer.

I can not understand why there are two .cs files, one for the design and another for the program itself.

Anyway, has anyone ever had this difficulty in understanding the file structure and some other important information in building the code?

Another question: Is it possible to create forms in C # using the Windows Console Application option of VS? I'm referring to the same way we do in Eclipse when we're going to create visual components using raw code.

Thank you.

    
asked by anonymous 23.06.2015 / 21:10

1 answer

8

Why are there two .cs files that are intended for one design and one for the program code itself

A .cs is the source of the design you've made at hand. When you run the program, this design .cs will run and will put the items on the screen based on this code.

The other .cs is the code that will be run based on events

Another question: Is it possible to create forms in C # using the Windows Console Application option of VS?

Yes, just make the code below, but it is not recommended:

using System.Windows.Forms;

[STAThread]
static void Main() 
{
    Application.EnableVisualStyles();
    Application.Run(new Form());
}
    
23.06.2015 / 21:22