Catalog Description
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
Students
will be provided additional study material as and when required.
Content of the Course
1.
Introduction
2.
Overview of the Microsoft .NET Platform
3.
Development Environment Features
4.
Language and Syntax Enhancements
5.
Object-Oriented Design for Visual Basic .NET
6.
Object-Oriented Programming in Visual Basic .NET
7.
Constructors
and Overloaded Functions
8.
Inheritance
9.
Arrays and
Jagged Arrays
10.
Strings,
Structures and Properties
11.
Namespaces
and Exception Handling
12.
Virtual
Functions
13.
Interfaces
14.
Collection
Classes
15.
WinForms
16.
Transformation
and Delegates
17.
Standard
Controls
18.
Image
Viewer and User Defined Controls
19.
Serialization
and MDI
20.
Multithreading
21.
Synchronization
22.
DLL and COM
23.
Assemblies
24.
Versioning and Interoperability
25.
ADO.NET
26.
Developing Components in Visual Basic .NET
27.
Deploying Applications
28.
Upgrading to Visual Basic .NET
Lab
Practice Questions
Lab Exercise 1:
Create a project in VB.NET to display
the information about a particular project. The form should look as shown
below:
After that create an inherited form
that inherits from the above form, and make changes so that the inherited form
looks as shown below:
Solution:
Step 1: Go to Startà Programsà Visual Studio 2008.
Create
a new VB.NET Windows Forms Application.
Step 2:
Design
the form as shown below in the screen shot and name the form as BaseAboutForm.
The
above form contains the following controls:
PictureBox:
Set the image property to the file that has been sent to your e-mail. This
contains the logo of the company.
5
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
2
Command buttons with captions set to System Info and OK.
For
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"
msinfo.Start()
For
the click event of the OK Command button type the following code:
Me.Close()
Also
add the following two lines of code at the top:
Option Explicit On
Namespace FormInheritance
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.
Step 4:
Now we have to create an inherited form.
Click on Projectà Add New
Itemà Inherited
Form
The screen shot is shown below:
Step 5:
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
parent form.
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
controls.
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: