How to Write "Hello World!" in Visual C Sharp

Go to the Start Menu, click All Programs, and select Visual Studio., Go the the box where is says 'Name' and type in 'Hello World' then click the button beside it. , A blank form or "Window" will appear on the design tab., Resize the form to a...

11 Steps 2 min read Medium

Step-by-Step Guide

  1. Step 1: Go to the Start Menu

    When the IDE (Integrated Develop Environment) loads, you'll first see the Start Page.

    Now, go to the top left part of the screen and click the file New Project and a dialog box should pop up.

    By default, it is set to make a Windows Form application.
  2. Step 2: click All Programs

    , In our case, we want the program to respond to us clicking the button.

    And to do that, we we need to add a button control to the blank form.

    So go the the right side of the screen.

    You should see the Toolbox.

    Open the Common Controls; under the pointer, there is a button control.

    Double click it.

    The default location of the control on the form should be in the top left corner. , To resize the form, hover over the right bottom corner and drag it until it is the size you want. , By default, this creates the Click Event.

    An event is when the program response to the user's input. ,")
  3. Step 3: and select Visual Studio.

    It may take the IDE a little wile to compile the code you just entered, but, once the compiler is done, your program will pop up. ,". , If you want, you can rename the button in the properties tab and add a proper caption to the window border.
  4. Step 4: Go the the box where is says 'Name' and type in 'Hello World' then click the button beside it.

  5. Step 5: A blank form or "Window" will appear on the design tab.

  6. Step 6: Resize the form to a smaller square (of your choosing) and place the button in the middle.

  7. Step 7: double click the button.

  8. Step 8: Write the following code in between the two curly-braces (you may copy and past if you want): MessageBox.Show("Hello World!!

  9. Step 9: Click the little green play button.

  10. Step 10: Click the button and see your program say "Hello World!!

  11. Step 11: That was easy!

Detailed Guide

When the IDE (Integrated Develop Environment) loads, you'll first see the Start Page.

Now, go to the top left part of the screen and click the file New Project and a dialog box should pop up.

By default, it is set to make a Windows Form application.

, In our case, we want the program to respond to us clicking the button.

And to do that, we we need to add a button control to the blank form.

So go the the right side of the screen.

You should see the Toolbox.

Open the Common Controls; under the pointer, there is a button control.

Double click it.

The default location of the control on the form should be in the top left corner. , To resize the form, hover over the right bottom corner and drag it until it is the size you want. , By default, this creates the Click Event.

An event is when the program response to the user's input. ,")

It may take the IDE a little wile to compile the code you just entered, but, once the compiler is done, your program will pop up. ,". , If you want, you can rename the button in the properties tab and add a proper caption to the window border.

About the Author

M

Margaret Young

Experienced content creator specializing in pet care guides and tutorials.

33 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: