Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,143,252 members, 7,780,531 topics. Date: Thursday, 28 March 2024 at 03:57 PM

A Comprehensive Tutorial On Vb 6.0 - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / A Comprehensive Tutorial On Vb 6.0 (4518 Views)

My Board Games In Vb 6.0 / Vb 6.0/vb .NET & Intranet/internet Application Development / Post Ur Vb 6.0 Questions Here (2) (3) (4)

(1) (Reply) (Go Down)

A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 10:20am On Jan 19, 2010
Despite the effort of LuckCo to answer many questions on VB, we still see new post every day from newbies requesting for VB programmer. As a result of this, i wish to start a comprehensive tutorial on the topic. Questions are hereby welcome from any interested person.


Starting Visual Basic

Visual Basic provides a sophisticated Windows programming environment that is easy to use yet capable of producing powerful programs. Since it's a system you can create a visible part of a self contained window application in a very short time. without the need to write any program code at all. You can then add short procedures for performing specific tasks, using an extended form of traditional BASIC programming language. This tutorial would show you how to create fully-fledged windows app, quickly an effectively.

Visual Basic editions

The latest version of VB comes in three different editions:

1. Learning edition - creates fully- functional windows applications using a set of standard tools
2. Professional edition - adds specialised tools, a report writer and Internet capability
3. Enterprise edition - includes tools for setting up client / server applications

This tutorial concentrates on the learning edition features, where are common to all three editions.


Windows version

Visual Basic 6.0 is supplied only as a 32-bit version and must therefor be run under windows 95 or later versions. App created with VB6.0 can be run only under these versions of windows; you will not be able to run ur app under 16-bit windows 3.1

Note
The VB cd contains a number of development tools plus an extensive help system that covers the whole of the microsoft Visual studio environment. You do not have to install everything


this is just an introduction. just follow the thread for the full package
Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 9:40am On Jan 20, 2010
Installing Visual Basic

Visual Basic is installed in a similar way to most other Windows app. Load the CD and run the setup program as follows:
1 Click on the windows start button and the the run option
2 Type D:\setup in the run box and click OK
3 Follow the instructions as they appear on the screen.
At the end of the setup process, Visual Basic will add an opion to the program menu, leading to the main Visual basic program plus some subsidiary programs



Take Note
If your CD is not drive D, replace D in the command with the drive letter.





Tip
If u're short of HDD space u don't have to install the complete application: choose custom rather than Typical from the installation options and deselect those part of the system you do not need (they can always be added to the installation later by re running the the setup program. full installation of the enterprise edition requires 200 mb of disk space.


Tip
Create a Visual Basic folder and shortcut icon on the windows desktop. In explorer, open the windows start menu program folder and copy the microsoft Visual Basic 6.0 folder icon to the windows desktop folder (click on the Visual Basic 6.0 folder, hold down [Ctrl] and drag the folder onto 'Desktop').


to be continued,
Re: A Comprehensive Tutorial On Vb 6.0 by jacob05(m): 10:02am On Jan 20, 2010
God bless Man!. learning BASIC in school, maybe it could be of help.
Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 4:17pm On Jan 20, 2010
Running Visual Basic[color=#000099][/color]

Starting the program
1. Click on the start button to display the start menu
2. Move the pointer to programs and Microsoft Visual basic 6.0
3. Click on the Visual Basic 6.0 option.

Alternatively, if you have created a visual basic folder, double click on Visula Basic 6.0 icon.

Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 9:33am On Jan 21, 2010
I guess something is wrong somehow.

because i've bee posting the continuation of this tutorial ever since i started it, but I don't why it's been removed, to confirm this, you can check my latest post in my profile to see those post. More so, the numbers of reply to this thread says 3 plus this one it would be 4 now but 2 are missing. any explanation? if this one is not also removed.
Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 2:46pm On Jan 21, 2010
Am afraid if this post will not also be removed

But I will always Aspire to Acquire what I Desire even if I Misfire in the process, I will never Retire I will always Refire !.

The New Project window of Visual Basic.

As you enter Visual Basic 6.0. a new project windowis displayed. This dialog box effectively provides a menu for deciding what type of work u're going to do.
To create ur first application, double click on Standard EXE. The main Visual Basic windows is displayed.

Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 9:09am On Jan 22, 2010
Thank God the missing post has been returned.

Rounding up the tutorial for the week,

Visual Basic Windows

The Visual Basic windows is confusing when you first see it. The main Visual Basic windows contains a number of other windows. Initially, six of these are open; others will pop up as you develop ur application.\

NOTE
Four of the windows are 'docked' on the side of the main window when you first come into Visual Basic. Any of them can be made 'float' by dragging the title bar into the middle of the screen. They can be re sized .



Main Window
The main window contains all the element u would expect to in a windows application.

1. The title bar contains the name of your current initially (Project 1) and the visual buttons for minimising maximising and closing the window.

2. The VB menu bar includes drop down menus . Many of the options in these menus are described later in this tutorial.

3. The toolbar contains a number of icons that provide shortcuts to the most frequently used Visual Basic Operations. On the right of the toolbar, two sets of figures provide size and position information about any selected Visual Basic element (Details in later lessons).

Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 9:03am On Jan 26, 2010
Toolbox

Any windows contains a number of different objects: command buttons, text boxes, labels and so on. These are called controls. When you are creating a window within VB, these controls can be added by dragging them from the toolbox. The pointer icon in the top left corner of the toolbox is used for selecting the existing controls so that they can be moved, resized or changed in some other way.
The toolbox controls are described in detail later in this lesson.

Take note

The controls included in the toolbox
depend on the version of VB u're using and
the 'ActiveX' controls that have been selected



Tip
A large number of other controls are supplied with Visual basic but not
included on the toolbox initially. You can add these using the components option in the Project menu. You can also change the way the toolbox is organised by moving controls onto tabs other than general
You can add these using

Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 8:41am On Jan 27, 2010
Form1 and Form Designer window

A visual Basic application usually consists of one or more windows. At the design, stage, these windows are called forms. To start u off, VB supplies a sinfle form, called form1. This form will be renamed and resized when you begin to develop the application: other forms will be added as required. For VB 6.0, the forms are held in the form designer window.

Take note
It is possible to create an application
that has no form at all: for example,
an application to display a reminder
at a specific time. In such cases, you need to delete form1.
You will see how later in these lesson>

Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 9:01am On Jan 27, 2010
Project Explorer window

For each window in your final application there are corresponding VB form, and each form has its on file on disk. Usually, there is also at least one file containing the program code for the application and if your forms use any third-party tools, these tools will be held in aditional files. All these files go together to make up a project from which the application is built.
The project explorer windo lists the project files. You can add existing files to a project or removes files. A file can be partof more than one project: for example, you may use the same window in two independent app. Removing a file from a project does not affect the file itself; it is still intact on disk.

Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 3:16pm On Jan 28, 2010
Properties window

Each Form, and each control on a form, has a set of properties. These determine the appearance of the form or controls and the way it behaves. A form has properties that specify how big it is and where it is on the screen, whether it is visible when the application starts, whether it has Minimise and Maximise buttons, and so on. Most controls have a large number of properties, some of which are similar to those of forms. For instance, a command button has the same size and position as a  form but also includes properties to determine which key can be used to activate it. Each type of control has a different set of properties. For each control, you can change the settings of individual properties ( so all command buttons have the same properties but different settings)

The properties window displays the properties of the selected form or control, and allows you to change their settings. Some of the more important properties are described later in this tutorial.

Take note

Some properties can also be changed more simply; for instance. the size or position of a form can be altered by dragging the object or its borders



Form Layout window

The form layout window helps you determine the initial positions of the form on the screen when the application is run ( Not available in VB 4.0)

Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 10:27am On Jan 29, 2010
View Options

Any of the Vb form can be cleared from the screen by clicking the close button in the top right-hand corner of the window.

To redisplay the toolbox, Project explorer window, properties window or form layout window. Click at the appropriate option in the view menu; to redisplay form1 and form designer window, double click form1 in the project explorer window( or click on form1 and then on the view object button).

The VB windows can also be moved by dragging their title bars or resized by dragging their corners or edges. The maximise button on the form designer window expands the window to fill the remaining space in the main window.

Take note
If you close the main window, the entire VB application will be closed down, including all associated windows. If youa have changed anything in the current project, you will be given the opportunity to save it.

Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 8:11am On Feb 02, 2010
The First Form


Any window application is made up of one or more distinct windows. A window can be used to display information, allow user to enter data or to provide options for the user to select. At development, the windows that make up a finished VB application are called forms.. The forms you create become the windows through which the users access your application.

It is up to you, when designing a form, to describe how the window will behave: whether it is on- screen initially; whether the user can minimize or resize it; and so on. However, you should remember that once a window has been displayed it is the user who decide how things happen and when the window will be closed down. The more objects( buttons, scroll bar, textbox etc) you put on a form, the less control you have over user's action.

A form starts off as an empty window, which may have a title bar and control button( Control menu box, Minimise button, maximise button and close down button). Within it you may add other objects: buttons, lists, check boxes etc.
Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 12:25pm On Feb 02, 2010
Form Files

The details of each form are stored in a separate form file, with an FRM extension this holds information such as the initial size of the form, its position and so on. there will usually be some VB forms , determining how the application will respond when user takes action on a window's control. For instance when the user closes the window, the code attached to the form should take neccessary action on data has been entered and then remove the window. The code for a particular form is stored in the form file. The forms in an application are listed in the project explorer window; in each case the name of the form file is given alongside the form name , in brackets

Take Note

forma are also used for most dialog box ( e.g those to select  a file or enter a password) though some simple msg boxes can be created as and when require within the code.


Tips

because a form is totally self contained (the form file contain both a description of the form and all the code attached to it). The same form can be reused in other application. this means that all your applications can have the same 'look and feel' as well as reducing the amount you spend creating applications.

Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 12:53pm On Feb 04, 2010
Form1[color=#000099][/color]

VB supplies a default form to start the project: Form1. You can use this as your application's front-end window. The form can be customised as follows:

1. Increase or Decrease the size of the window by dragging one of the form's corners or it's borders.
2. Move the form to a suitable position by dragging the form1 box inside the form layout window; this will be the window's initial position when the program is run.

Other changes to the window and the the ways in which it behaves are made by altering the form's properties.
Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 3:45pm On Feb 05, 2010
Form Properties

The appearance and behavior of a window are determined by the corresponding form's properties. These specify detail as size and position of the window, whether it can be minimized and closed, and so on. For each property there is a single setting.

When you click on Form1 Project explorer window the properties are listed in the Properties window, in the left hand-column. The corresponding settings are shown on the right. Any property can be changed by clicking on the appropriate line. In some cases there are fixed number of options and you must chose from a drop-down list, for others , a value for the setting can be typed directly.

Take note

Although the properties are set as you develop, you can also write code to change them while the application is running. (later)

Re: A Comprehensive Tutorial On Vb 6.0 by PallyG(m): 6:12am On Feb 06, 2010
[color=#770077][/color] Thks for the tutorials. I wud love to learn how to develop website interface that uses databases like those in banks and schools. I'm currently learning MS SQL, will i need 2 learn a programming language like Visual basic too?
Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 8:46am On Feb 08, 2010
Nope, you started with a right choice. Your next lesson would be PHP i guess u have the ideal of html already. Then all you need to do is to get a web design tool to reduce the stress of coding. You can call me on 08060678106 for more gist.
Cheers!
Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 9:11am On Feb 12, 2010
Back to the tutorial

Now we want to examine some form's properties and the explanation of the settings

starting with

Name and Caption property

The name of the form is the name that appear in the project explorer window; the caption is the piece of text that appears in the title bar (from the front-end window, usually the appropriate title). Either can be changed by clicking on the existing settings and typing over it.

The name property is shown in the in brackets so that it appears at the top of the alphabetic property list. It setting should be changed to something that tell you what that form does. By convention, the first three characters should be 'frm'. For example 'frmMainMenu' for the main menu window. The name will be used in creation of filename.
Re: A Comprehensive Tutorial On Vb 6.0 by BigStar1(m): 4:59pm On Feb 24, 2010
I'm still thinking about when i would be chance to continue this tutorial i really get alot to share here.

please bear with me.
Re: A Comprehensive Tutorial On Vb 6.0 by YD(m): 4:38pm On Feb 25, 2010
nice one. bigstar good topic.
nice one
Re: A Comprehensive Tutorial On Vb 6.0 by stephinnoyewole(m): 7:50am On Aug 20, 2014
Pls I want to write a VB program having one command "Compute" which can compute for both area "using a click" and perimeter using "dbl click"
Tanx...

(1) (Reply)

Ambitious Programmers Lets Talk / I Want To Learn Php / CBT In Python. V2 By Fleshbone

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 78
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.