Developing Microsoft® .NET Applications for Windows® (Visual Basic® .NET) - Pdf 74

Part Number: X08-82484
Course Number: 2565A Released: 05/2002

Delivery Guide
Developing Microsoft
®
.NET
Applications for Windows
®

(Visual Basic
®
.NET)

Information in this document, including URL and other Internet Web site references, is subject to
change without notice. Unless otherwise noted, the example companies, organizations, products,

Contents

Introduction
Introduction..............................................................................................................1
Course Materials ......................................................................................................2

Prerequisites.............................................................................................................3

Course Outline .........................................................................................................4

Demonstration: Expense Report Application...........................................................6

Demonstration: Purchase Order Application ...........................................................9

Microsoft Certified Professional Program .............................................................15

Facilities.................................................................................................................17

Module 1: Introducing Windows Forms
Overview..................................................................................................................1

Lesson: Creating a Form..........................................................................................2

Lesson: Adding Controls to a Form.......................................................................17

Lesson: Creating an Inherited Form.......................................................................26

Lesson: Organizing Controls on a Form ................................................................35

Lesson: Creating MDI Applications ......................................................................43


Lesson: Licensing a Control ..................................................................................26

Review ...................................................................................................................37

Lab 3.1: Building Controls ....................................................................................39
iv Developing Microsoft® .NET Applications for Windows® (Visual Basic® .NET) Module 4: Using Data in Windows Forms Applications
Overview................................................................................................................. 1

Lesson: Adding ADO.NET Objects to and Configuring ADO.NET Objects in a
Windows Forms Application .................................................................................. 2

Lesson: Accessing and Modifying Data by Using DataSets................................. 14

Lesson: Binding Data to Controls......................................................................... 33

Lab 4.1: Accessing Data by Using ADO.NET...................................................... 47

Lesson: Overview of XML Web Services ............................................................ 59

Lesson: Creating a Simple XML Web Services Client......................................... 65

Lesson: Persisting Data......................................................................................... 73

Lab 4.2: Calling an XML Web Service ................................................................ 84

Review .................................................................................................................. 88

Overview................................................................................................................. 1

Lesson: The .NET Asynchronous Programming Model......................................... 2

Lesson: The Asynchronous Programming Model Design Pattern .......................... 7

Lesson: How to Make Asynchronous Calls to Any Method................................. 19

Lesson: Protecting State and Data in a Multithreaded Environment .................... 27

Review .................................................................................................................. 33

Lab 7.1: Making Asynchronous Calls to an XML Web Service........................... 35

Module 8: Enhancing the Usability of Applications
Overview................................................................................................................. 1

Lesson: Adding Accessibility Features................................................................... 2

Lesson: Adding Help to an Application.................................................................. 9

Lesson: Localizing an Application........................................................................ 21

Review .................................................................................................................. 34

Lab 8.1: Enhancing the Usability of an Application............................................. 37
Course Evaluation................................................................................................. 53
Developing Microsoft® .NET Applications for Windows® (Visual Basic® .NET) v
Lesson: Working with Bitmap Images...................................................................15


Developing Microsoft® .NET Applications for Windows® (Visual Basic® .NET) vii About This Course
This section provides you with a brief description of the course, audience,
suggested prerequisites, and course objectives.
Windows Forms is the new platform for Microsoft
®
Windows
®
application
development, based on the Microsoft .NET Framework. The .NET Framework
provides a clear, object-oriented, extensible set of classes that enables
developers to develop rich Windows Forms applications. Additionally,
Windows Forms can act as the local user interface in a multi-tier distributed
solution.
This three-day instructor-led course provides students with the skills required to
build Windows Forms applications by using the .NET Framework.
This course is intended for the intermediate programmer who is responsible
for designing and building Windows Forms applications by using the
.NET Framework. It is designed for developers who have Microsoft
Visual Basic
®
.NET development skills.
Typically, these individuals perform the following key activities:
!
Help with creation of functional specifications

!
Create menus in a Windows Forms application.
!
Add code to form and control event procedures in a Windows Forms
application.
!
Create Multiple Document Interface (MDI) applications.
!
Use dialogs in Windows Forms applications.
!
Validate user input in a Windows Forms application.
!
Create and use user controls in a Windows Forms application.
!
Create licenses for controls.
!
Bind Windows Forms applications to various data sources by using
Microsoft ADO.NET.
!
Consume XML Web services from Windows Forms applications.
!
Use .NET and COM components in a Windows Forms application.
!
Call Microsoft Win32
®
APIs from a Windows Forms application.
!
Upgrade Visual Basic 6.0 applications to Visual Basic .NET.
!
Print documents in a Windows Forms application.

9:30 11:00 Module 1: Introducing Windows Forms
11:00 11:10 Break
11:10 11:40 Lab 1.1: Creating Windows Forms
11:40 12:30 Lunch
12:30 2:30 Module 2: Working with Controls
2:30 2:45 Break
2:45 3:15 Lab 2.1: Working with Controls
3:15 4:15 Module 3: Building Controls
4:15 4:45 Lab 3.1: Building Controls

Day 2
Start End Module
8:30 9:00 Day 1 review
9:00 11:00 Module 4: Using Data in Windows Forms Applications
11:00 11:15 Break
11:15 11:45 Module 4: Using Data in Windows Forms Applications
(continued)
11:45 12:30 Lab 4.1: Accessing Data by Using ADO.NET
12:30 1:00 Lunch
1:00 1:30 Module 4: Using Data in Windows Forms Applications
(continued)
1:30 1:45 Lab 4.2: Calling an XML Web Service
1:45 2:00 Break
2:00 3:00 Module 5: Interoperating with Managed Objects
3:00 3:30 Lab 5.1: Interoperating with COM and Calling Win32 APIs
3:30 5:00 Module 6: Printing and Reporting in Windows Forms
Applications
5:00 5:45 Lab 6.1: Printing Formatted Documents

x Developing Microsoft® .NET Applications for Windows® (Visual Basic® .NET)

Default.htm. This file opens the Trainer Materials Web page.
!
Readme.txt. This file explains how to install the software for viewing the
Trainer Materials compact disc and its contents and how to open the Trainer
Materials Web page.
!
2565A_ms.doc. This file is the Manual Classroom Setup Guide. It contains
the steps for manually setting up the classroom computers.
!
2565A_sg.doc. This file is the Automated Classroom Setup Guide. It
contains a description of classroom requirements, classroom configuration,
instructions for using the automated classroom setup scripts, and the
Classroom Setup Checklist.
!
Powerpnt. This folder contains the Microsoft PowerPoint
®
slides that are
used in this course.
!
Pptview. This folder contains the Microsoft PowerPoint Viewer, which is
used to display the PowerPoint slides.
!
Setup. This folder contains the files that install the course and related
software to computers in a classroom setting.
!
StudentCD. This folder contains the Web page that provides students with
links to resources pertaining to this course, including additional reading,
review and lab answers, lab files, multimedia presentations, and course-
related Web sites.
!

description of classroom requirements, classroom setup instructions, and the
classroom configuration.
!
Democode. This folder contains files that are used in the instructor
demonstrations.
!
Flash. This folder contains the installer for the Macromedia Flash 5.0
browser plug-in.
!
Fonts. This folder contains fonts that are required to view the PowerPoint
presentation and Web-based materials.
!
Inetpubs. This folder contains files used by the sample Web-based
applications in this course.
!
Labfiles. This folder contains files that are used in the hands-on labs. These
files may be used to prepare the student computers for the hands-on labs.
!
Media. This folder contains files that are used in multimedia presentations
for this course.
!
Mplayer. This folder contains the setup file to install Microsoft Windows
Media

Player.
!
Practices. This folder contains files that are used in the hands-on practices.
!
Sampapps. This folder contains the sample applications associated with this
course.

you can use lowercase letters when you type a directory name or
file name in a dialog box or at a command prompt.
ALL CAPITALS
Indicate the names of keys, key sequences, and key
combinations — for example, ALT+SPACEBAR.
monospace
Represents code samples or examples of screen text.
[ ] In syntax statements, enclose optional items. For example,
[filename] in command syntax indicates that you can choose to
type a file name with the command. Type only the information
within the brackets, not the brackets themselves.
{ } In syntax statements, enclose required items. Type only the
information within the braces, not the braces themselves.
| In syntax statements, separates an either/or choice.
!
Indicates a procedure with sequential steps.
... In syntax statements, specifies that the preceding item may be
repeated.
.
.
.
Represents an omitted portion of a code sample.

THIS PAGE INTENTIONALLY LEFT BLANK


Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual
property rights covering subject matter in this document. Except as expressly provided in any
written license agreement from Microsoft, the furnishing of this document does not give you any
license to these patents, trademarks, copyrights, or other intellectual property.

 2002 Microsoft Corporation. All rights reserved.

Microsoft, MS-DOS, Windows, Windows NT, Active X, Authenticode, FrontPage, IntelliSense,
MSDN, PowerPoint, Visual Basic, Visual C#, Visual Studio, Win32, Windows, Windows Media
are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other
countries.

The names of actual companies and products mentioned herein may be the trademarks of their
respective owners. Introduction iii Instructor Notes
The Introduction module provides students with an overview of the course
content, materials, and logistics for Course 2565A, Developing Microsoft .NET
Applications for Windows
®
(Visual Basic
®
.NET).
To teach this course, you need the following materials:
!

Expense Report application is also a good way to introduce students to the
skills that they will acquire in the course. If a student arrives after you have
done the demonstration, have the student review the steps for this
demonstration before doing any of the labs.
Presentation:
30 minutes
Required materials
Introduction
Course materials
Prerequisites
Course outline
Demonstration: Expense
Report Application
iv Introduction It is very important that you go through this demonstration before teaching the
rest of the course. The Purchase Order application is one of two primary
scenarios for practices and labs throughout the course. Demonstrating the
Purchase Order application is also a good way to introduce students to the skills
that they will acquire in the course. If a student arrives after you have done the
demonstration, have the student review the steps for this demonstration before
doing any of the labs.
Inform students about the Microsoft Certified Professional (MCP) program and
the various certification options.
Explain the class hours, extended building hours for labs, parking, restroom
location, meals, phones, message posting, and where smoking is or is not
allowed.
Let students know if your facility has Internet access that is available for them
to use during class breaks.

-
TRAINER USE
******************************
Your instructor will ask you to introduce yourself and provide a brief overview
of your background, addressing the bulleted items on the slide as appropriate.
2 Introduction Course Materials
!
Name card
!
Student workbook
!
Student Materials compact disc
!
Course evaluation

*****************************
ILLEGAL FOR NON
-
TRAINER USE
******************************
The following materials are included with your kit:
!
Name card. Write your name on both sides of the name card.
!
Student workbook. The student workbook contains the material covered in
class, in addition to the hands-on lab exercises.
!


Prerequisites
!
Experience programming with Microsoft Visual Basic
!
An understanding of the Microsoft .NET Framework
!
Experience developing applications
!
Recommended prerequisite course
"
Course 2559A: Introduction to Visual Basic .NET
Programming with Microsoft .NET
-or-
"
Equivalent knowledge

*****************************
ILLEGAL FOR NON
-
TRAINER USE
******************************
This course requires that you meet the following prerequisites:
!
Experience programming with Microsoft Visual Basic .NET
!
An understanding of the Microsoft .NET Framework
!
Experience developing applications
– and –

Visual Studio
®
.NET. It also covers organizing controls on a form and creating
Multiple Document Interface (MDI) applications. This module is meant mainly
to be a review of concepts that you are familiar with but also presents some new
concepts, such as how to use Visual Studio .NET tools for organizing controls
on a Windows form.
Module 2, “Working with Controls,” explains how to code for event procedures
associated with different controls. The module covers how to use some of the
Windows Forms intrinsic controls in an application. It also explains how to use
dialog boxes, validation controls, and menus in a Windows Forms application.
The module also includes a section on the controls collection and how to add
controls at run time.
Module 3, “Building Controls,” describes the options for building your own
controls. It explains how to extend the functionality of an existing Windows
Forms control, combine multiple existing controls into a composite control, and
build a new custom control. It also covers how to add design-time attributes and
licensing support to a control.
Module 4, “Using Data in Windows Forms Applications,” describes how to
bind Windows forms to various data sources by using Microsoft ADO.NET and
the Bindings collection. The module also provides an overview of the XML
Web services programming model and covers how to create applications that
use XML Web services. The module also provides an overview of how to
persist data to and read data from files and isolated storage.
Introduction 5 Course Outline (continued)
!
Module 5: Interoperating with Managed Objects

interface of an application.
Module 8, “Enhancing the Usability of Applications,” explains how to use the
accessibility, Help, and localization features available in the .NET Framework.
Module 9, “Deploying Windows Forms Applications,” explains assemblies and
the use of strong-named assemblies and the global assembly cache in the .NET
Framework. It also covers how to configure and deploy your Windows Forms
applications.
Module 10, “Securing Windows Forms Applications,” explains how to use the
security features in the .NET Framework in Windows Forms applications.
6 Introduction Demonstration: Expense Report Application
In this demonstration, you will see how to use
the Expense Report application

*****************************
ILLEGAL FOR NON
-
TRAINER USE
******************************
In this demonstration, you will see how to use the Expense Report application.

If you performed a default installation of the course files, install_folder
corresponds to C:\Program Files\Msdntrain\2565.

!
To run the demonstration
1. Open the InternalBusinessApp.sln solution file from the install_folder\
Sampapps\Business Application Shell.

The Make Travel Plans and Procurement buttons are just placeholders
with no real functionality. Students will work on implementing various parts
of the Expense Reporting functionality. The Exit button closes the
application.
6. Click Expense Reporting. Also demonstrate the multithreading feature of
the application.
When the user clicks the Expense Reporting button, an Expense Report
control panel form appears.


Nhờ tải bản gốc

Tài liệu, ebook tham khảo khác

Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status