Left Quote    I think there is a world market for maybe five computers.
- Thomas Watson, Chairman of IBM 1943    
Right Quote
[login] | [Register]

Getting Started with VB 6.0

by: bs0d
Page: 4 of 9
(View All)

Option Buttons... Formats

Option Buttons - Group of controls where only one can be selected at a time.

Check Boxes - Group of controls where more than one can be selected at a time.

Frame - Control that often acts as a container for a group of option buttons or check boxes.

Image - Type of control that is used to hold a graphic. Shape - Type of control used to place rectangles, squares, ovals and circles on a form.


The VALUE property of the option button is set TRUE if you want it to be selected, otherwise, FALSE. Set the option buttons CAPTION property to the text you want to appear next to the option button. When assigning an option button, a variable name always starts out with the prefix, opt. If you want an event to occur when you click on an option button, you can double-click on the option button from your form to enter in the code you want executed.


More than one check box can be selected at a time.
The VALUE property of the option button is set to CHECKED if you want it to be selected, otherwise, set it to UNCHECKED.
A second option is to set the VALUE property on check boxes to a 0, 1 or 2.
  • 0 - UnChecked
  • 1 - Checked
  • 2 - Grayed

Set the CAPTION property to the text you would like to appear next to the check box.
When assigning a variable name, always start out with prefix chk.

If you want an event to occur when you click on a check box, double-click the button to place code behind.


Click on the images PICTURE property and locate the folder or drive where the picture is located.
Select the picture you want, and it will be placed on the form.
If you set the image STRECH property to TRUE, this will size the picture to the size of the control you have defined on the form.

All controls that are images should begin with an img prefix.


The types of shapes and codes are shown below...
  • 0 - Rectangle
  • 1 - Square
  • 2 - Oval
  • 3 - Circle
  • 4 - Rounded Rectangle
  • 5 - Rounded Square

All controls that are shapes should begin with the shp prefix.


Use the crosshair pointer to drag a line across the screen. You may rotate the line in any direction and stretch it until releasing the move button.
All line controls should begin with the lin prefix.
Determining Focus

Focus - Refers to the currently selected control on the form. This can be indicated by an | - Beam, selected text, highlighted caption or dotted border. The control with focus is ready to receive input.

SetFocus - A built-in function that when executed will move the cursor to the control and give that control focus. SetFocus can be used with text boxes, command buttons, option buttons and check boxes.

Examples of setFocus:

Working With Strings

Concatenation - Refers to combining two or more smaller strings into a larger string. In VB, you can either use the & or + symbols to concatenate.

Examples of Concatenation:



(This code would go in the FORM LOAD (double click any empty space on the form.)

< Name of form > .Top = (Screen.Height - < Name of form > .Height)/2
< Name of Form > .Left = (Screen.Width - < Name of form > .Width)/2

< Name of Form > - This is the actual name of the form as you have saved it in your program.

If you named your form, "myForm" then you would code the statement in the following way:

1  |  2  |  3  |  4  |  5  |  6  |  7  |  8  |  9  |  
Next »

No Comments for this page.

You Must be logged in or a member to comment.

Tutorial Stats

Tutorial Stats

0 Total Comments
4.16 Rating of 5 (6 Votes)


Tutorial Options

· Login to Rate This Article
· Login to Post a Comment
· Read more by this author
Digg This Article! Bookmark This Article Reddit: Bookmark This Article BlinkList: Blink This Article! YahooMyWeb BlogMarks: Add This Mark! Furl: Save This Article Spurl: Mark This Article



· Coding a Webserver
· Using Crystal Reports in VB
Your Article Here

"" Copyright © 2002-2020; All rights lefted, all lefts righted.
Privacy Policy  |  Internet Rank