|
Home
Visual Basic .NET Programming Tutorials
Learn Visual Basic .NET Table of
Contents
Learn
Visual Basic .NET - Table of Contents
1. Introduction to the Visual Basic .NET Environment
Preview 1-1
Course Objectives 1-2
What is Visual Basic .NET? 1-3
Visual Basic .NET versus Visual Basic 1-5
Visual Basic .NET 2003 versus Visual Basic .NET 1-6
A Brief Look at Object-Oriented Programming (OOP) 1-7
Structure of a Visual Basic .NET Windows Application 1-8
Steps in Developing a Windows Application 1-10
Starting Visual Basic .NET 1-11
Visual Basic .NET Integrated Development Environment (IDE) 1-13
Drawing the User Interface 1-21
Example 1-1: Stopwatch Application - Drawing Controls 1-24
Opening a Saved Visual Basic .NET Project 1-25
Setting Properties of Controls at Design Time 1-27
Setting Properties at Run Time 1-30
How Names Are Used in Control Events 1-31
Use of Form Name Property 1-32
Example 1-2: Stopwatch Application - Setting Properties 1-34
Writing Code 1-36
Variables 1-39
Visual Basic .NET Data Types 1-40
Variable Declaration 1-42
Arrays 1-45
Constants 1-46
Variable Initialization 1-47
Intellisense Feature 1-48
Example 1-3: Stopwatch Application - Writing Code 1-49
Running An Application (Startup Object) 1-52
Class Review 1-55
Practice Problems 1 1-56
Problem 1-1. Beep Problem
Problem 1-2. Caption Problem
Problem 1-3. Enabled Problem
Problem 1-4. Date Problem
Exercise 1: Calendar/Time Display 1-57
2. The Visual Basic .NET Language
Review and Preview 2-1
A Brief History of BASIC 2-2
Visual Basic .NET Statements and Expressions 2-3
Strict Type Checking 2-5
Visual Basic .NET Arithmetic Operators 2-7
Comparison and Logical Operators 2-9
Concatenation Operators 2-11
Visual Basic .NET Functions 2-12
String Functions 2-13
Dates and Times 2-17
Random Number Object 2-20
Math Functions 2-21
Example 2-1: Savings Account 2-23
Tab Stops and Tab Order 2-28
Example 2-2: Savings Accounts – Setting Tabs 2-30
Improving a Visual Basic .NET Application 2-31
Visual Basic .NET Decisions - If Statements 2-32
Select Case - Another Way to Branch 2-35
Key Trapping 2-37
Control Focus 2-39
Example 2-3: Savings Account - Key Trapping 2-40
Visual Basic .NET Looping 2-44
Visual Basic .NET Counting 2-47
Example 2-4: Savings Account - Decisions 2-49
Class Review 2-56
Practice Problems 2 2-57
Problem 2-1. Random Number Problem
Problem 2-2. Price Problem
Problem 2-3. Odd Integers Problem
Problem 2-4. Pennies Problem
Problem 2-5. Code Problem
Exercise 2-1: Computing a Mean and Standard Deviation 2-58
Exercise 2-2: Flash Card Addition Problems 2-59
3. Exploring the Visual Basic .NET Toolbox
Review and Preview 3-1
Function Overloading 3-2
MessageBox Dialog 3-3
Form Object 3-8
Button Control 3-11
Label Control 3-13
TextBox Control 3-15
Example 3-1: Password Validation 3-18
CheckBox Control 3-23
RadioButton Control 3-25
GroupBox Control 3-27
Panel Control 3-29
Handling Multiple Events in a Single Procedure 3-31
Control Arrays 3-33
Example 3-2: Pizza Order 3-35
ListBox Control 3-42
ComboBox Control 3-45
Example 3-3: Flight Planner 3-47
Class Review 3-51
Practice Problems 3 3-53
Problem 3-1. Message Box Problem
Problem 3-2. Tray Problem
Problem 3-3. List Box Problem
Problem 3-4. Combo Box Problem
Exercise 3: Customer Database Input Screen 3-54
4. More Exploration of the Visual Basic .NET Toolbox
Review and Preview 4-1
Control Z Order 4-2
NumericUpDown Control 4-3
DomainUpDown Control 4-5
Example 4-1: Date Input Device 4-7
Horizontal and Vertical ScrollBar Controls 4-10
TrackBar Control 4-13
Example 4-2: Temperature Conversion 4-15
Picture Box Control 4-20
OpenFileDialog Control 4-23
Example 4-3: Picture Box Playground 4-26
Legacy Controls 4-31
DriveListBox Control 4-33
DirListBox Control 4-34
FileListBox Control 4-35
Synchronizing the Drive, Directory, and File List Box Controls 4-37
Example 4-4: Image Viewer 4-39
Class Review 4-45
Practice Problems 4 4-46
Problem 4-1. Tic-Tac-Toe Problem
Problem 4-2. Number Guess Problem
Problem 4-3. File Times Problem
Exercise 4: Student Database Input Screen 4-47
5. Windows Application Design and Distribution
Review and Preview 5-1
Application Design Considerations 5-2
Multiple Form Visual Basic .NET Applications 5-3
Adding a Module 5-6
Visual Basic .NET Multiple Document Interface (MDI) 5-7
Example 5-1: Shopping Cart 5-8
Using General Procedures in Applications 5-21
Example 5-2: Circle Geometry 5-26
Using General Functions in Applications 5-30
Example 5-3: Average Value 5-32
MainMenu Control 5-38
ContextMenu Control 5-44
Font Object 5-45
FontDialog Control 5-47
Example 5-4: Note Editor 5-49
Distribution of a Visual Basic .NET Application 5-55
Debug Versus Release Configurations 5-58
Application Icons 5-59
Visual Basic .NET Setup Wizard 5-62
Installing/Removing a Visual Basic .NET Application 5-74
Class Review 5-76
Practice Problems 5 5-77
Problem 5-1. Note Editor About Box Problem
Problem 5-2. Normal Numbers Problem
Problem 5-3. Context Menu Problem
Exercise 5: US/World Capitals Quiz 5-78
6. Sequential Files, Error-Handling and Debugging
Review and Preview 6-1
Sequential Files 6-2
Sequential File Output (Variables) 6-4
Application Path 6-9
Example 6-1: Writing Variables to Sequential Files 6-10
Sequential File Input (Variables) 6-14
Example 6-2: Reading Variables from Sequential Files 6-16
Parsing Data Lines 6-24
Example 6-3. Parsing Data Lines 6-26
Building Data Lines 6-30
Example 6-4: Building Data Lines 6-30
Configuration Files 6-37
Example 6-5: Configuration Files 6-39
Writing and Reading Text Using Sequential Files 6-42
SaveFileDialog Control 6-45
Example 6-6: Note Editor - Reading and Saving Text Files 6-48
Error Handling 6-50
Run-Time Error Trapping and Handling 6-51
Example 6-7: Note Editor - Error Trapping 6-54
Debugging Visual Basic .NET Programs 6-56
Example 6-8: Debugging Example 6-58
Using the Debugging Tools 6-61
Debugging Strategies 6-72
Class Review 6-73
Practice Problems 6 6-74
Problem 6-1. Option Saving Problem
Problem 6-2. Text File Problem
Problem 6-3. Data File Problem
Problem 6-4. Debugging Problem
Exercise 6-1: Information Tracking 6-76
Exercise 6-2: ‘Recent Files’ Menu Option 6-77
7. Graphics Techniques with Visual Basic .NET
Review and Preview 7-1
Simple Animation 7-2
Example 7-1: Simple Animation 7-4
Timer Control 7-7
Example 7-2: Timer Control 7-9
Basic Animation 7-11
Example 7-3: Basic Animation 7-13
Random Numbers (Revisited) and Games 7-18
Example 7-4: One-Buttoned Bandit 7-20
Randomly Sorting Integers 7-27
Example 7-5: Random Integers 7-28
Graphics Methods 7-31
Graphics Object 7-32
Colors 7-34
ColorDialog Control 7-36
Pen Object 7-38
DrawLine Method 7-39
Graphics Methods (Revisted) 7-40
Persistent Graphics 7-43
Example 7-6: Drawing Lines 7-46
Rectangle Structure 7-50
DrawRectangle Method 7-52
Brush Object 7-53
FillRectangle Method 7-54
Example 7-7: Drawing Rectangles 7-55
DrawEllipse Method 7-60
FillEllipse Method 7-61
Example 7-8: Drawing Ellipses 7-62
DrawPie Method 7-67
FillPie Method 7-69
Example 7-9: Drawing Pie Segments 7-71
Pie Charts 7-76
Line Charts and Bar Charts 7-79
Coordinate Conversions 7-82
Example 7-10: Line, Bar and Pie Charts 7-88
Class Review 7-96
Practice Problems 7 7-97
Problem 7-1. Bounce Problem
Problem 7-2. Dice Rolling Problem
Problem 7-3. RGB Colors Problem
Problem 7-4. Plotting Problem
Problem 7-5. Pie Chart Problem
Exercise 7-1: Blackjack 7-98
Exercise 7-2: Information Tracking Plotting 7-99
8. More Graphics Methods and Multimedia Effects
Review and Preview 8-1
Mouse Events 8-2
Example 8-1: Blackboard 8-5
Persistent Graphics, Revisited (Image and Bitmap Objects) 8-14
Example 8-2: Blackboard (Revisited) 8-17
More Graphics Methods 8-20
Point Structure 8-21
DrawLines Method 8-22
DrawPolygon Method 8-24
FillPolygon Method 8-25
Example 8-3: Drawing Lines and Polygons 8-27
DrawCurve Method 8-33
DrawClosedCurve Method 8-34
FillClosedCurve Method 8-35
Example 8-4: Drawing Curves 8-37
Example 8-4A: Drawing Animated Curves 8-43
HatchBrush Object 8-46
Example 8-5: Hatch Brush 8-48
LinearGradientBrush Object 8-53
Example 8-6: Linear Gradient Brush 8-55
TextureBrush Object 8-60
Example 8-7: Texture Brush 8-61
DrawString Method 8-64
Multimedia Effects 8-69
Animation with DrawImage Method 8-70
Example 8-8: Bouncing Ball 8-72
Scrolling Backgrounds 8-78
Example 8-9: Horizontally Scrolling Background 8-81
Keyboard Events 8-85
Collision Detection 8-87
Example 8-10: Collision Detection 8-88
Windows API Functions 8-91
Sounds with the Windows API 8-93
Example 8-11: Playing Sounds 8-95
Example 8-12: Bouncing Ball with Sound! 8-97
Timing with the Windows API 8-99
Example 8-13: Stopwatch Application (Revisited) 8-101
Class Review 8-103
Practice Problems 8 8-104
Problem 8-1. Blackboard Problem
Problem 8-2. Rubber Band Problem
Problem 8-3. Shape Guessing Game
Problem 8-4. Plot Labels Problem
Problem 8-5. Bouncing Balls Problem
Problem 8-6. Moon Problem
Problem 8-7. Sound File Problem
Exercise 8: The Original Video Game - Pong! 8-105
9. Other Visual Basic .NET Topics
Review and Preview 9-1
Other Controls 9-2
LinkLabel Control 9-4
Example 9-1: Link Label Control 9-5
TabControl Control 9-7
Example 9-2: Tab Control 9-10
MonthCalendar Control 9-16
DateTimePicker Control 9-18
Example 9-3: Date Selections 9-19
RichTextbox Control 9-22
Example 9-4: Rich Text Box Example 9-25
ImageList Control 9-28
ToolBar Control 9-31
Example 9-5: Note Editor Toolbar 9-34
ToolTip Control 9-39
Example 9-6: Tool Tip Control 9-40
Adding Controls at Run-Time 9-42
Example 9-7: Rolodex – Adding Controls at Run-Time 9-44
Printing with Visual Basic .NET 9-47
Printing Pages of a Document 9-50
PageSetupDialog Control 9-56
PrintDialog Control 9-59
PrintPreviewDialog Control 9-61
Example 9-8: Printing 9-63
Adding a Help System to Your Application 9-70
Creating a Help File 9-72
Starting HTML Help Workshop 9-73
Creating Topic Files 9-75
Creating Table of Contents File 9-78
Compiling the Help File 9-82
HelpProvider Control 9-85
Example 9-9: Help System Display 9-87
Class Review 9-89
Practice Problems 9 9-90
Problem 9-1. Biorhythm Problem
Problem 9-2. Rich Textbox Note Editor Problem
Problem 9-3. Loan Printing Problem
Problem 9-4. Plot Printing Problem
Problem 9-5. Note Editor Help Problem
Exercise 9: Phone Directory 9-92
10. Visual Basic .NET Database and Web Applications
Review and Preview 10-1
Database Applications 10-2
Database Structure and Terminology 10-3
Database Access Tools 10-7
Database Connection 10-8
DataSet Objects 10-12
Simple Data Binding 10-20
Database Navigation 10-22
Example 10-1: Accessing the Books Database 10-23
Creating a Virtual Table 10-28
Example 10-2: Creating a Virtual Table 10-29
DataView Objects 10-34
Example 10-3: ‘Rolodex’ Searching of the Books Database 10-36
Complex Data Binding 10-40
Web Applications 10-42
Web Form Application Requirements 10-44
Starting a New Web Application 10-46
Web Form Controls 10-49
Building a Web Application 10-55
Example 10-4: Loan Payments 10-57
Example 10-5: Loan Repayment Schedule 10-62
Class Review 10-66
Course Summary 10-67
Practice Problems 10 10-68
Problem 10-1. New DataView Problem
Problem 10-2. Multiple Authors Problem
Problem 10-3. Stopwatch Problem
Exercise 10: The Ultimate Application 10-69
11. Object-Oriented Programming (OOP)
Preview 11-1
Objects in Visual Basic .NET 11-3
Adding a Class to a Visual Basic .NET Project 11-4
Declaring and Constructing an Object 11-5
Adding Properties to a Class 11-6
Another Way to Add Properties to a Class 11-8
Validating Class Properties 11-9
Adding Constructors to a Class 11-11
Adding Methods to a Class 11-13
Inheritance 11-18
Example 11-1. Savings Account 11-24
Inheriting from Visual Basic .NET Controls 11-31
Building a Custom Control 11-32
Adding New Properties to a Control 11-36
Adding Control Event Procedures and Methods 11-40
Example 11-2. Savings Account (Revisited) 11-42
Class Review 11-47
Appendix I. Visual Basic .NET for Visual Basic Programmers
Introduction I-1
Overall Impression II-2
Converting Visual Basic 6 Applications To Visual Basic .NET II-4
Where To Next? II-6
Appendix II. General Purpose Procedures and Functions
Average II-2
BarChart II-2
CircleGeometry II-4
DegFToDegC II-4
LineChart II-4
NormalNumber II-6
Payment II-6
PieChart II-7
RectangleInfo II-8
SortIntegers II-9
SoundEx II-10
Statistics II-11
XuserToXclient II-12
YuserToYclient II-12
Practice Problems Solutions P-1
Exercise Solutions E-1
Back to Top
Back to Learn Visual Basic .NET
|