Education is the most powerful weapon
which you can use to change the world.
-Nelson Mandela
 
Home   News   Tips   Glossary   Templates   Forums   Help   Logon   Order   Contact Us  
 
NEW Release: Access Advanced Level 2    dismiss
 
 
Courses - Microsoft Visual Basic 104
Description: Using Microsoft Visual Basic
Running Time: 71 minutes
Pre-Requisites: Visual Basic 103 strongly recommended
Versions: We use Microsoft Visual Basic 6.0, but lessons are valid for most earlier versions of VB, including 4 and 5. If you have VB.NET or VB 2005, the Visual Basic code we use is similar, but the programming interface has changed. These VB courses do NOT cover VBA (Visual Basic for Applications) which is what you need for Microsoft Office programming. For VBA, see the individual Office applications (Word, Excel, Access, etc.) Click here for more information on VB.NET courses.


Order Now: $15.99

 

 

 Click here for the Teacher's Outline
 
Notice: this course covers the older Visual Basic 6.0 programming application. Microsoft no longer sells VB6. If you want to learn VB6, you'll have to find a used copy somewhere like eBay or Craigslist. We will be updating this course for use with Visual Basic 2013 soon. If you've purchased this course within the last year, you'll get a free upgrade when it's released.

This course follows VB103. We'll begin by looking at how to create programs with multiple forms. We will learn about the Project Explorer, the Load Form method, the Form.Show method, the vbModal property, and learn about Modal vs. Modeless forms.



The Visual Basic Project Explorer
 

You'll learn how to read a value from another form. You'll also learn about the Date function, how to calculate days (and years) between two dates, the CDate function, the End statement, how to Hide and Unload a form (and what the difference is), and how to change the Startup Form.



In this example, we'll make two forms - a Customer form and
an Age Calculator form. The Age Calculator will read the
Date of Birth from the Customer form and calculate Age in years.
 

Next you'll learn all about Label Properties (Alignment, Appearance, BorderStyle, Font, FontColor, BackColor, ToolTipText) and - more importantly - how to manipulate all of these with your VB code (not just in design). We'll also learn about the Timer Control and assigning string variables to label captions.



In this example, the Age Calculator automatically calculates the
Customer's age and updates it every second in realtime.
 

In the next lesson we'll learn about Multi-Line Text Boxes, Scroll Bars, several new properties, events, and functions: MaxLength, Enabled, Validate, IsDate, and IsNumeric. I'll show you how to select text with VB code.



In this example, we disable the Age Calculator button until
the user enters a valid Date in the DOB field. Also, I've selected
the first several characters of the Multi-Line Textbox with code.
 

In lesson five we learn a lot more about Command Buttons, including how to create a default button and a cancel button. We'll learn a trick to make ALT-key combinations for our buttons (so a user could press ALT-A, for example, to push a button). We'll also see how to create graphical buttons and change their color.


Next we learn aboutt creating Check Boxes. We'll learn about the BackStyle and BackColor properties, how to read the CheckBox value in our code (vbChecked, vbUnchecked).

 

Then we'll learn how to change CheckBoxes into Toggle Buttons. We can change their colors, change their captions, put images on them, and do all kinds of neat stuff with them... all at runtime in our VB code.



When the user clicks on this Toggle Button, our VB code
changes the caption and the color at runtime.


 
Yes, I should have chosen an image that matched the
background color of the button, but this is just an example.

 

 Click here for the Teacher's Outline
 


Try a FREE Demo Lesson

 
 
 

Student Interaction: Visual Basic 104

Richard on 1/1/2008:  VB104 covers working with multiple forms, load and show events, modal forms, date functions, startup form, rounding numbers, multi-line textboxes, and checkboxes.
Robert M. Lilly on 3/3/2008: Hi Richard:
I tried to take advantage of your advice about backing up the computer. But when I tried to down load Amicron Netbackup.zip (4MB). I received the following message! “This page cannot be found.” I would appreciate if you could resolve this problem.

Thanks
Bob Lilly

Richard Rost on 3/13/2008: Robert, thanks for letting me know. I've fixed the links and made sure the NetBackup program was up there. You can find it at http://www.amicron.com/netbackup
Nicos Solomonides on 7/23/2009: In your VB104 lesson 03 you
say that AgeMinutes=AgeHours*60 and
AgeSeconds=AgeHours*60 again. How come? And why
AgeSeconds is not equal to Ageminutes*60?

Richard Rost on 7/23/2009: Minutes = Hours * 60
Seconds = MINUTES * 60

If I said something else in the video, then I was incorrect. At what time index does this happen?

Nicos Solomonides on 7/24/2009: Look at the video at 03:34
and why AgeMonths=CustomerAge/30???

Richard Rost on 7/25/2009: Nicos, the CustomerAge is the number of DAYS that person has been alive. So if you've been alive 60 days, you're 60/30 or ROUGHLY 2 months old.

This wasn't meant to give you an EXACT number of months. It's a "close enough" calculation.

 

You may want to read these articles from the 599CD News:

 

Learn
 
Accessindex
Excelindex
Wordindex
Windowsindex
PowerPointindex
Photoshopindex
Visual Basicindex
ASPindex
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
Lost Password
Free Upgrades
Insider Circle
Student Databases
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Articles
Search Our Site
Waiting List
Production Schedule
Collapse Menus
Help
 
Live Chat
Customer Support
WalkThru Tutorials
Troubleshooting
FAQs
TechHelp
Consulting Services
About Us
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Order
 
Video Tutorials
Handbooks
MYOLP Memberships
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Gift CDs
Contact
 
Live Chat
General Info
Support Policy
Contact Form
Email Us
Mailing Address
Phone Number
Fax Number
Course Survey
Facebook    Twitter

Google Plus    LinkedIn

Blog RSS Feed    YouTube Channel
Richard Rost Microsoft MVP