Tuesday, July 28, 2009

Visual C# Express Edition 2008 IDE

C# is a modern object oriented programming language.I am going to have a series of blog on C# Windows forms. These series of blogs are intended to be the study material for my training sessions. So I might be following more of a tutorial walk through mode of blogging.

All the examples are based on Visual C# 2008 Express Edition which is a free development tool from Microsoft.

Fire up Visual Studio C# 2008 Express Edition. From the File menu select New Project. The New Project Dialog will appear, which will present you with different project types available in express edition. Note the WPF Application and WPF Browser Application project types which are new to 2008. This series of blogs are going to concentrate on windows forms applications, so select Windows Forms Applications and click Ok.

You will be greeted with the IDE or Integrated Development Environment. Integrated Development Environment is the interface with which a programmer interacts with and develops application in Visual Studio.It comprises ofMenu Bar, ToolBar, ToolBox, Form Window, Properties Window, Solution Explorer, Code Windowand a host of other windows.If these windows are not visible by default you can navigate to View menu and select the window or use the short cut keys.

Its better to memorize short cut keys instead of using the mouse.
The short cut keys form various IDE components are as follows ToolBox (Ctrl Alt X), Properties Window (F4), Solution Explorer (Ctrl Alt L).

MenuBar and ToolBar requires no explanation. All windows users are very much familiar with MenuBar and ToolBar.

Just like a mechanic or electrician is having his own toolbox comprising of Screw drivers, testers, wires, etc. we .net programmers do have a toolbox with which we work. Toolbox is having a collection of controls.

Controls inside toolbox are arranged as tabs. Toolbox is having 8 tabs. The first tab All Windows Forms contains all the controls including containers, menus, data, components, printing and dialogs.

Common Controls tab contains commonly used controls Button, TextBox, Label, ListBox, ComboBox, etc.

Containers tab contains container controls. Container controls are those controls which acts as containers for other controls. This including simple containers like GroupBox, Panel and SplitContainers to complext containers like FlowLayoutPanel, TableLayoutPanel and TabControl.

Menus and Toolbars tab contains controls required for creating menus, context menus and toolbars.

Data tab contains controls required for database interaction.

Components tab contains those controls which doesn't have a visual interface at runtime. This includes controls like Timer, ErrorProvider, etc.

Printing tab contains print related controls like PrintPreviewDialog, PrintPreviewControl, PrintPreviewControls, etc.

Dialogs tab contains commonly used dialogs like OpenFileDialog, SaveFileDialog, ColorDialog, FontDialog, etc.

In addition to the existing tabs you can add your own tabs and controls to it. This feature comes handy for having a collection of COM controls or adding yours own controls to toolbox.

GroupBox Panel and TabControl
GroupBox Panel and TabControl

Group Box and Panel are container controls in Windows Forms. By container control I mean those controls which hosts other controls. These controls are used for logically group controls


A TabControl is used to have a collection of TabPages, thus avoiding the need for multiple forms as in the case with Windows Task Manager which can be invoked by pressing Ctl+Alt+Del. Here the functionalityn of 5 forms is incorporated in a single form.

Clicking the TabPages property in the properties window will invoke the TabPages Collection editor which can be used for adding Tab Pages.

private void btnDbNext_Click(object sender, EventArgs e)
tabControl1.SelectedIndex = 1;


No comments:

Post a Comment