I want to create a GUI app in C# so I went to Youtube and watched some tutorials but all of them where using Visual Studio, not Visual Studio Code.
How can I write a GUI app in VS Code and not Visual Studio?
I want to create a GUI app in C# so I went to Youtube and watched some tutorials but all of them where using Visual Studio, not Visual Studio Code.
How can I write a GUI app in VS Code and not Visual Studio?
using System;
using System.Windows.Forms;
using System.Drawing;
namespace program{
class program{
private static void Main(){
Form mainForm = new Form();
Label lblFirst = new Label();
mainForm.Width = 300;
mainForm.Height = 400;
lblFirst.Text = "Hello World";
lblFirst.Location = new Point(150,200);
mainForm.Controls.Add(lblFirst);
Application.Run(mainForm);
}
}
}
There is simple hello world app which was done without Visual Studio. Every control is class in C#. You should create new object from these classes and you'll prepare all properties manual just like that.
You can't, vscode is basically a rich text editor with extension, visual studio is a full IDE, it has built in templates, full solution analysis, and most importantly it can manage all dependencies and connect all parts of the solution. If you want gui with c#, you'll have to install visual studio, there's a free community edition with all the features you'll need. Also it will make it so much easier for you. Use the right tool for the job.