Visual Basic Explorer
Visual Basic Explorer
 Navigation
 Home


 Coding
 Source Code

 FAQ Center

 VB Tips

 Downloads

 ToolBox

 Tutorials

 VB Games

 VB News

 VB Award

 VB Forums



 Affiliates
 Planet Source Code

 Rent a Coder

 DirectX4VB


 Misc
 Search

 Feedback

 Advertise

 About


Need to hire
a VB coder?

Please support our sponsor:

 Home 
 Site Map 
 Forums 
 News 
 Feedback 

Chapter 1, Visual Basic 5 Interactive Course, Lesson 1

What is the Interactive Course Series?

The Interactive Course series is a line of traditional, printed computer books that are enhanced and amplified by the use of an interactive site on the Internet's World Wide Web. The Interactive Course concept provides an inexpensive alternative to taking costly classes at community colleges and private educational facilities. By providing real-time, interactive testing and near real-time personalized tutoring from course mentors, the Interactive Course series transforms instructional books into a virtual academy that could provide an attractive, low-cost educational alternative in this era of ever-spiraling tuition and other education expenses.

Many thanks to Waite Group Press for generously providing this excellent tutorial. If you'd like to know more about their interactive courses, excellent publications or other products they provide, you can jump to their site from here. This tutorial is only chapter 1 of their Visual Basic tutorial.


WHAT'S ALL THAT STUFF ON MY SCREEN?

Even if you've been programming for a while, your first look at Visual Basic 5 (VB 5) is likely to startle you. There sure is a lot of stuff there! True, and a lot of it is new to Visual Basic. In this chapter, you will learn to maneuver around the Visual Basic 5 integrated development environment and to set it up for convenient programming. You won't be writing any programs, but learning these techniques can be a big time saver for you. Even if you are upgrading from VB 3 or VB 4, you will find something new here.

GETTING STARTED

We all have to start sometime. If you haven't done so already, double-click on the VB 5 icon and let's take a ride.

The Opening Screen

The first thing you get when you double-click on the VB 5 icon is an opening dialog box that offers a confusing array of choices. The dialog box is shown in Figure 1-1.


Figure 1-1: The opening dialog box of Visual Basic 5

Wow! Let's take a look at what all those icons mean.

Your Mileage May Vary
There are three different versions of Visual Basic 5. Some of the features available in the Professional and Enterprise Editions are not available in the Learning Edition. The screens shown throughout this book are from the Enterprise Edition. They may vary in some detail from the screens you see. All these choices exist because Visual Basic 5 can compile your programs into several different types of files:

Standard .EXE files, which are normal programs.
ActiveX .EXE files, which are programs that allow other programs to access their data. These are known as out of process servers because they operate in their own process space--memory that Windows sets aside for programs to use.
ActiveX .DLL files--dynamic link libraries, which are collections of functions and procedures that can be accessed by other programs. DLL files are known as in-process servers; they operate in the same memory space as the program that uses them.
ActiveX Controls, which are components that you add to your program. You will learn about controls in Chapter 5, Controls.
ActiveX Document .DLL and .EXE files that are programs that have been modified to work within Web browser programs such as Internet Explorer. They are suitable for distribution and viewing over the Internet.
Add-in files, which can be "added in" to the Visual Basic programming environment. They are used to automate things that you do over and over again.
The VB Application Wizard, which builds a part of your program for you. Obviously it doesn't know what you want the program to do, but it can create a large part of the program's user interface.

Most of the applications in this book use the standard EXE option.

There are three tabs on this opening screen. To open a project file from the disk, select the Existing tab. A dialog box like the one in Figure 1-2 opens.


Figure 1-2: The Existing tab

As you can see, this is a lot like the standard Windows 95 Explorer window, and you negotiate it the same way. Later in the book, you will learn to include windows like this in your own programs.

The third tab is the Recent tab. As you might expect, it contains a list of the most recent projects you have been using. Figure 1-3 shows the Recent tab.


Figure 1-3: The Recent tab

You will find this tab handy as you work through the lessons in this book.

The Development Environment

Go back to the New tab and select Standard EXE. Click on Open to begin a new project, and let's take a look at where you
will work. The default development environment is shown in Figure 1-4.


Figure 1-4: The default development environment

There's a lot there! Let's take a closer look at the default items on the screen.

Visual Basic 5 creates Windows programs. The user interface for Windows programs is a window. (Tough stuff!) Each window that your program uses is created on a form in the development environment. Think of a form as a blank window on which you will draw the part of program that the user sees. When you are writing the program that makes a form work (called the code), you use the Code window. The items on a form are called controls. All the controls that you can use in your project are in the toolbox. Microsoft supplies several controls that are not automatically included in the toolbox. You can also purchase or download other controls, called third-party controls. These extra controls add functionality to your VB programs. Later in this book, you will see how to add more controls to the toolbox. The toolbar provides quick access to things that are found in the menus. There are several specialized toolbars, too. The standard toolbar is the one you will use the most.

The Project Explorer window lets you access the different parts of your project. You may have several forms and any number of classes and program modules in a single project. (Don't worry if some of this is mysterious right now. It won't be for long!) The Project Explorer gives you instant access to any part of the project at any time. Properties are attributes of your form or an object on your form. You have properties, too. You have a height property, a weight property, and a hair color property. You can set the properties of the form or a control on the form in the Properties window. The Form Layout window lets you set the position your form will take when your program begins to run. It is a visual way to set two of the form's properties, Top and Left.

The Immediate window is a kind of scratchpad. You can try out some of your program's instructions there. When you are troubleshooting a program, this becomes a Debug window where you can change the values that your program is manipulating.

Dockable?

All the windows except the Form window have a property of their own: They are dockable. A dockable window is one that attaches itself to the nearest edge of the screen or to the nearest other dockable window. When you move a dockable window, it "snaps" to the location. A docked window is dominant. If you drag the toolbox to the top of the screen, for example, it docks there and all the other windows change size to accommodate it.

Windows that have their Dockable property enabled also have another property. They are "always on top." If they are open, they are visible and not hidden behind another window.

You can view the Dockable property by right-clicking your mouse inside the window. If the word Dockable is checked, it is a dockable window. You can, of course, change that property. If a window is not docked, it is a "floating" window.

Whether you choose to have a window docked or not is a matter of personal preference.


<VBExplorer ,Lesson 1 , Lesson 2 , Lesson 3 , Lesson 4 , Lesson 5 , EZone >




Home | About | What's New | Source Code | FAQ | Tips & Tricks | Downloads | ToolBox | Tutorials | Game Programming | VB Award | Search | VB Forums | Feedback | VBNews | Copyright & Disclaimer | Advertise | Privacy Policy |

Quick searches: Site Search | Advanced Site Search 

Copyright 2002 by Exhedra Solutions, Inc.
By using this site you agree to its terms and conditions
VB Explorer and VBExplorer.com are trademarks of Exhedra Solutions, Inc.