Learning is not attained by chance, it must
be sought for with ardor and diligence.
-Abigail Adams
 
Home   News   Tips   Glossary   Templates   Forums   Help   Logon   Order   Contact Us  
 
NEW Release: Access Developer Level 3   dismiss
 
 
Courses - Microsoft Visual Basic 103
Description: Using Microsoft Visual Basic
Running Time: 72 minutes
Pre-Requisites: Visual Basic 102 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 picks up where VB102 left off. We will begin by talking about Events and Properties, such as GotFocus, LostFocus, ForeColor, BackColor, and FontBold. We'll look at the Object Browser, color constants (such as vbRed, vbBlue, etc.) and how to get any color into your objects.



In this example, the Last Name field changes
color using the GotFocus event as the user
tabs to it, or clicks on it.
 

Next we'll learn about the different variable types, such as Date, Integer, Single, and so on. We'll learn about valid variable names and naming conventions. We'll learn how to Dim variables, and the difference between public and private variables. We'll learn how to find the length of a string with the Len function. And, we'll learn about the Option Explicit keyword and what it does.



In this example, we add up the length of the
First Name and Last Name boxes with LEN function
 

Next we'll learn about a powerful programming technique called the Select Case statement which can be used to eliminate huge blocks of If/Then code.

 

We'll use the Select Case to create a Student Test Score application where we'll figure a student's average and letter grade based on his test scores.

 

Next we'll learn about the Form Load event, the Form Resize Event, and see how different properties such as the Caption, Width, and Height of a form can be changed at runtime. We'll make a button so the user can resize a form.



In this example, when the user clicks the resize button
the form opens up. Notice the pink label also resizes!

 

Next we'll learn about the Border Style and Startup Position properties. This will allow us to change the way our forms look on the screen, and where they first pop up when the program loads. I'll show you how to manually place your form on the screen where you want it to start.



The Form Layout Window allows you to manually
position your forms anywhere on the screen.

 

 Click here for the Teacher's Outline
 


Try a FREE Demo Lesson

 
 
 

Student Interaction: Visual Basic 103

Richard on 1/1/2008:  VB103 covers events & properties, variables, select case, resizing forms with code, BorderStyle, StartupPosition, Len, option explicit, and much more.
Robert M. Lilly on 2/18/2008: Hi Richard:
How do I download the Project and forms that you created in each of VB lessons?
When I started taking your lessons I found it very difficult to emulate your instructions, with one monitor. I had and old monitor that I had keep as a spare. I installed it on my system (Windows SP Professional) as a second monitor. Now I view your courses on it and constructed your programs on the other. Thought you might want to pass this on to your students. It sure makes it easy to work along with your instructions and displays.
Bob Lilly
You remember, the old guy who buys all your courses!



Richard Rost on 2/28/2008: Hi there Bob! All of the VB project files from class have been moved to 599cd.com/VB/StudentProjects. Enjoy!
Karl Peters on 4/17/2009: Just something i've noticed, programming has a "symbolic logic" to it. Perhaps a good prerequisite to programming could be a minor symbolic logic class just to get a future programming student in the groove so to speak on thinking in logic terms? (But then again, this is all kinda new to me except for failed attemtps in the past to learn programming on my own) So a symbolic logic course is probably a lame idea LOL
Harry Corbello on 1/25/2011: How do I move the properties window from the top to the right side?

Reply from Richard Rost:

You should just be able to click and drag to move the different panes and windows around the screen. I usually leave the properties window "docked" to the right side.

Charles Brumagem on 1/25/2011: 1) can I put a case statment with in a case statemen?

Reply from Richard Rost:

Sure can.

Select Case LastName
Case "Smith"
Select Case FirstName
Case "Joe"
MsgBox "Hi Joe Smith"
Case "Ed"
MsgBox "Hi Ed Smith"
End Select
End Select

Philausifur on 1/27/2011: The book Logic for Dummies coverers logic exaustively, It gets sophiticated. Simple logic is much easier. You might try wikapedia.
Harry Corbello on 1/30/2011: time 17:48, I am using visual Badic 5. When I clicked run then the msgbox read 0. when I typed in smith, then nothing happened. How did you get the new Len numbe to come up?
I appolgize for the flaky form I submited this question the first time.

Harry Corbello on 2/1/2011: I am using VB 5. When I enter the LastName, after the program is running, then nothing happens.
How is this explained.

Reply from Richard Rost:

Harry, I would have to see your program to tell you for sure. Honestly, I've NEVER used VB 5, although I know it has a LOT of bugs and other problems. I jumped right from VB 4 to VB 6.

ROSYAIMI on 4/21/2011: what a great affect...!!thank a lots, i wish and you don't mind to see your video clips on this topic.....pls
 

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