A Blog By Bhushan Kediya
Introduction to C#
Adding Controls to Windows Form
Mar 5th
To add a Control to ‘form1’, first make sure that the Visual C# Toolbox is open.
You can see the toolbox to the left of ‘Form1’.
If not then Select the View à Toolbox menu item or Press Ctrl + Alt + X.
- Now simply drag a textbox from the toolbox to ‘Form1’, or just double-click the ‘Textbox’ control in the toolbox. This adds a textbox to ‘Form1’.
- Now add a button to ‘Form1’ in the same manner as shown.
Properties
- Click the button in ‘Form1’ to select it so the fuzzy outline appears around it.
- Now, move to the properties window at the lower right of the IDE. If not seen then select View à Properties Window or press F4 key.
- Click ‘Text’ Property in the properties window; change the text of the button from ‘button1’ to ‘Click Me’.
The properties window lists properties, the Property on the left & their values on the right. To change a property’s value, you only have to edit its setting and press enter.
To associate the code with button double-clicks the button, a file name ‘Form1.cs’ will open.
In it the method name:
private void button1_Click (object sender, Eventargs e)
{
}
Will see.
In this method write, textbox1.text = “JAI GAJANAN”;
Now Run the Program by Selecting Debug/start Debugging, or by pressing F5.
The application starts and when yu click the ‘Click Me’ button, the message “JAI GAJANAN” appears in the text box.
To close the application, click the close button (X) at upper right.
Visual C# has a handy way of letting you know when a file has been changed and has not been saved- an asterisk (*) will appear after the name of the file. But when compile the program it automatically saves the Code.
Creating First Windows Application
Dec 25th
Now, let’s start with creating the Windows Application.
- Select New option in the file menu.
- Select ‘Project option’ in the submenu.
- The window which will appears look like as shown below.
- Select the node ‘Visual C#’ in the ‘Project types’.
- Select the ‘Windows Forms Application’ in the ‘Templates’ section.
- Name the New Project & specify where to store it.
- Click OK button to create this New Visual C# Project.
- This creates New Windows Project and opens its Designer Window.
- The window which will appears look like as shown below.
- ‘Form1’ is the window that will become our new windows Application.
Introduction to Visual C#
Dec 18th
Visual C# is one of the most popular programming languages available today.
There are four types of Application based on Visual C#.
- Windows Forms (local to our machine).
- Web Forms (these are 4 across the internet).
- Console Application (Used in DOS-Window).
- Mobile Application (Used in Mobile Phone).
For Creating these applications .Net must be installed in your PC.
We can write code in normal text file also, but it will take lot time to Code. So code writing must be done in Visual Studio 2005 or Visual Studio 2008, the IDE by Microsoft to create Application based on DotNet.
After installing Visual Studio 2008, start it.
After Starting it will look like as follows:


