Friday, August 28, 2009

First C# application - "Hello World"


Here is the first C# application and lets have a fun.

1. Select New project from the menu through Windows application icon.
2. Select a name such as "Example1"
3. Click OK.

Now double click on the Program.cs in the solution explorer to see the generated code.

Double click on the Form1.cs in the solution explorer first.Then drag a button from the Toolbox to the Form.Next add a TextBox control using some basic procedure.Now align the Button and TextBox.

Now executed Example1 by pressing Ctrl+F5 and you will see a window with button and a textbox.

Close the window and double click on the Button, go to the button_click function.

Now add the following code.

TextBox1.text = "hello, world";

Here TextBox1 is the name of the textbox that is added to the form. Select the Button and TextBox > go to the properties to see or change the name.

Now save and run the application by pressing Ctrl+F5 and click on the Button. TextBox will show "hello, world".

This is the first basic C# application . HAVE FUN :)

Wednesday, August 26, 2009

Begnning C# part 1.

Here i will describe about basic tips of C# for beginners.

Follow the steps below .........

Downloading Visual C# Express:

1. http://www.microsoft.com/express/vcsharp/
2. Click the Visual Studio Express Download link.
3. Choose a directory to save the file.

Installing Visual C# Express:
After you have downloaded the setup file, you can start the Visual C# Express installation.

1. Go to the save directory and double click on the vcssetup.exe.
2. Click Next to install setup screen.
3. A series of dialog boxes will appear. Select the defaults and click Next to continue through the setup program. In the final dialog box, click Install.
4. After all the elements have been downloaded and installed, you may need to restart
your computer.


Click start menu to start Visual Stusio C# Express edition.

Creating the Windows Application:
After running the Visual C# Express edition , following steps are necessary to create a windows application.

1. Select File > New Project from the menu.
2. Select the windows application icon.
3. Change the default name to Example1.
4. Click ok.

Rename the solution:

1. Right-click the solution name in the Solution Explorer and select Rename from the
context menu.
2. The solution name will become editable. Change it to ThreeExamples.
3. Press Enter to apply the change.


Running the Windows Application :

You can chose any of the followings

1. Select Debug > Start Without Debugging
2. Use the keyboard shortcut Ctrl+F5


In the next part, i will show you the first application using Visual Studio C# application.