Home | | C Sharp and .NET Framework(CNF) | Data Grid View Class

Chapter: C# and .NET Framework

Data Grid View Class

C# programmers have made extensive use of forms to build user interfaces.

DATA GRID VIEW CLASS.

Ø   C# programmers have made extensive use of forms to build user interfaces.

 

Each time you create a Windows application, Visual Studio will display a default blank form, onto which you can drag the controls onto your applications main form and adjust their size and position.

 


 

Ø   The first step is to start a new project and build a form.

 

Ø   Open your Visual Studio and select File->New Project and from the new project dialog

 

box select Other Languages->Visual C# and select Windows Forms Application.

 

Ø Enter a project name at the bottom of the ialogue box and click OK button. The following picture shows how to create a new Form in Visual Studio.


 

Ø   After selecting Windows Forms Application , you can see a default Form (Form1) in your new C# project.

 

Ø   The Windows Form you see in Designer view is a visual representation of the window that will open when your application is opened.

 

Ø   You can switch between this view and Code view at any time by right-clicking the design surface or code window and then clicking View Code or View Designer.

 

Ø        The following picture shows how is the default Form (Form1) looks like.

 


Ø   At the top of the form there is a title bar which displays the forms title. Form1 is the default name, and you can change the name to your convenience .

 

Ø   The title bar also includes the control box, which holds the minimize, maximize, and close buttons.

 

Ø   If you want to set any properties of the Form, you can use Visual Studio Property window to change it. If you do not see the Properties window, on the View menu, click Properties window.

 

Ø   This window lists the properties of the currently selected Windows Form or control, and its here that you can change the existing values.

 


Ø   For example , to change the forms title from Form1 to MyForm, click on Form1 and move to the right side down Properties window, set Text property to MyForm. Then you can see the Title of the form is changed.

 

Ø   Likewise you can set any properties of Form through Properties window.

 

Ø        You can also set the properties of the Form1 through coding. For coding, you should right-click the design surface or code window and then clicking View Code.

 


Ø   When you right click on Form then you will get code behind window, there you can write your code

 

Ø   For example, if you want to change the back color of the form to Brown , you can code in the Form1_Load event like the following.

 

Ø        Private void Form1_Load(object sender, EventArgs e)

 

 

{

this.BackColor = Color.Brown;

}

 

Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
C# and .NET Framework : Data Grid View Class |


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.