To make a window in C#, you can use Windows Forms. Here's an example code snippet that creates a basic empty window:
main.cs464 chars23 lines
In this example, we create a new class MyForm
that inherits from Form
, and we set some basic properties such as the window title, width, and height. Then, in the Main
method, we create a new instance of MyForm
and run it using the Application.Run
method.
Note that to use Windows Forms in C#, you need to have the appropriate namespaces included at the top of your file, and you may also need to add a reference to the System.Windows.Forms
assembly in your project. If you are using Visual Studio, you can create a new Windows Forms project from the File > New > Project menu.
gistlibby LogSnag