This course covers a
brief outlook of .NET 2.0 Framework apart from database connectivity with
ADO.NET. This course also provides useful hands-on experience in creating
applications with VB.NET.
Required Readings, Text
Programming in Visual Basic.NET, Bradley
& Millspaugh, McGraw-Hill, 2005
Edition, ISBN: 007226215X
Required Additional Materials
will be provided additional study material as and when required.
Content of the Course
Overview of the Microsoft .NET Platform
Development Environment Features
Language and Syntax Enhancements
Object-Oriented Design for Visual Basic .NET
Object-Oriented Programming in Visual Basic .NET
and Overloaded Functions
Structures and Properties
and Exception Handling
Viewer and User Defined Controls
DLL and COM
Versioning and Interoperability
Developing Components in Visual Basic .NET
Upgrading to Visual Basic .NET
Lab Exercise 1:
Create a project in VB.NET to display
the information about a particular project. The form should look as shown
After that create an inherited form
that inherits from the above form, and make changes so that the inherited form
looks as shown below:
Step 1: Go to Startà Programsà Visual Studio 2008.
a new VB.NET Windows Forms Application.
the form as shown below in the screen shot and name the form as BaseAboutForm.
above form contains the following controls:
Set the image property to the file that has been sent to your e-mail. This
contains the logo of the company.
Label controls and set the Text property to reflect the product name, version
etc as shown in the screen shot above.
à Ensure that the Modifiers property of
all the label controls is set to Protected
Command buttons with captions set to System Info and OK.
the System Info button type the following event for its click event:
Dim msinfo As New Process()
msinfo.StartInfo.ErrorDialog = True
msinfo.StartInfo.FileName = "C:\Program
Files\Common Files\Microsoft Shared\MSInfo\msinfo32.exe"
the click event of the OK Command button type the following code:
add the following two lines of code at the top:
Option Explicit On
If option explicit is set to off then variable declaration is
not mandatory. However, it is a good practice to set explicit to on so that all
variables are declared.
The second declaration is the namespace declaration. It is a
good practice to use a namespace as it enables us to differentiate our classes
from other classes.
Step 3: Now Build
the application. Press F5.
Now we have to create an inherited form.
Click on Projectà Add New
The screen shot is shown below:
The Inheritance picker dialog box is displayed which allows
us to select the Parent form.
Since there is only one form in our project, it is displayed.
Note: You can use a form in any other project or for that
matter any other solution as the parent form. All you need is the executable
file of the class being inherited.
Step 6: Now, the
inheritance is complete. As you can see the child form looks exactly as the
Now you can modify those controls which you had declared as
Protected in the Parent form. Since we had declared all the label controls as
protected, it essentially means that we can modify the text of these label
Change the label text so that the final form looks as shown
below in the screen shot. After that build the application and you should see
the following screen: