This example will show you how to create a Windows Forms Application project in Visual Studio.
Start Visual Studio.
On the File menu, point to New, and then select Project. The New Project dialog box appears.
In the Installed Templates pane, select "Visual C#" or "Visual Basic".
Above the middle pane, you can select the target framework from the drop-down list.
In the middle pane, select the Windows Forms Application template.
In the Name text box, type a name for the project.
In the Location text box, choose a folder to save the project.
Click OK.
The Windows Forms Designer opens and displays Form1 of the project.
From the Toolbox palette, drag a Button control onto the form.
Click the button to select it. In the Properties window, set the Text
property to Say Hello.
Double-click the button to add an event handler for the Click
event. The Code Editor will open with the insertion point placed within the event handler function.
Type the following code:
C#
MessageBox.Show("Hello, World!");
VB.NET
MessageBox.Show("Hello, World!")
Press F5 to run the application.
When your application is running, click the button to see the "Hello, World!" message.
Close the form to return to Visual Studio.