In this article I explained how to create a hello world program for fresh developer using visual studio 2008

Step 1:Start -> All Programs -> Microsoft Visual Studio 2008 -> Microsoft Visual Studio 2008

Or you can use Run command. Open Run command and type devenv.exe press enter it will open the latest version of visual studio.

Step 2: Once visual studio have been launched you can see window like this

Then click File -> New -> Project.

It will open new project window, here you can see various kind application template here I am selected  windows Application with C#.

If you want to use VB as code behind language then click other languages in Project types. It will show the other languages in which we create an application. For instance if you want to create in VB then

Use the Visual Basic application templates.

In this new project window you can see textboxes

Name Textbox is use to get Name of the Application

Location Textbox is use to get Location of application that means where you going to store this application.

Solution Name is use to get Solution Name which is display in project explorer window.

Create directory of solution check box is use decide whether we need separate directory for this solution or not. If it’s checked it will create separate folder for the solution.

Step 3:  Once you created the application by default it will show one form with name of Form1. But you change by using property of the Form. In .Net each control is class and it has Property and Method.

Here you can see lot windows like solution explorer, properties, server explorer, toolbox etc…

Now you change the Form1 to Hello World by using Text Property in properties window.

Step 4: Drag the Button control from the Toolbox window to the Form and change the Name property to btnHelloWorld and Text Property to Hello World. By default the name is button1 and text is button1.

Name property is used to refer this control in code behind and Text property is used to display in the UI.

now your UI will be like this

Step 5: now it’s time to write the code just double click on the button and it will drive to code behind page with btnHelloWorld_Click event. This is default event for the button control.

Here type this is code

C#

private void btnHelloWorld_Click(object sender, EventArgs e)

{

MessageBox.Show(“Hello World”);

}

VB

Private Sub btnHelloWorld_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHelloWorld.Click

MessageBox.Show(“Hello World”)

End Sub

Step 6: Run the program using F5 it shows form, click Hello World Button is show one Message Box with Hello World Message like this

Finally you finished helloworld program.

Thanks for reading I hope this will help for the beginners.