Search Tools Links Login

VB6 Tutorial 24: OptionButton and CheckBox, Part 2


This lesson gives you a short description about the graphical style property of the OptionButton and CheckBox controls. This feature gives a graphical flavor to these controls. Its use has been demonstrated through sample programs.

This new interesting feature was introduced by Visual Basic 5.

Before proceeding you must have the read and understood the previous lessons:

Graphical Style of OptionButton

The OptionButton Control comes with a graphical style. First of all, you have to set its Style property to 1-Graphical. Doing so, the appearance of the control changes. The appearance becomes modern as well as graphical from its old fashioned style. Notice that a thin border around the control is drawn. After setting its Style property to 1-Graphical, it looks like the CommandButton control but works as an OptionButton. Set a picture to the OptionButton control using the Picture property. Choose a suitable icon for the control. You may assign a picture to the DownPicture property for the down state of the option button control. You may assign another picture or icon to the DisabledPicture property for the Disabled state of the control as well.

The attached project OSChoice will show you how the graphical optionbutton works.

Graphical Style of CheckBox

The CheckBox Control also comes with a graphical style. You need to set the Style property to 1. The appearance of the controls becomes graphical. Now set an image from the Picture property.

You may also assign pictures to the DownPicture and the DisabledPicture properties for the down state and disabled states respectively.

The graphical checkbox works very similarly to the graphical optionbutton, in that you need to set the style to graphical, and choose a picture for the face of the button. Also, as before, multiple checkboxes can be checked, while with an optionbutton, only one value can be selected.

Whenever you are using the Graphical style, remember that they do not loose their efficiency, meaning that an option button, when pressed, stays in the down state and other option buttons stay in the up state. And the in case of the CheckBox control, setting the Style property to Graphical does not loose their efficiency too. You can have multiple checkboxes pressed at the same time. In fine, the original meaning of the controls remain the same.

The graphical style of these controls makes a simple program interesting. So it is recommended to use it whenever it is appropriate.

About this post

Posted: 2018-04-07
By: vb6boy
Viewed: 648 times

Categories

Visual Basic 6

VB6 Tutorial

Attachments

OSChoice.zip
Posted: 4/7/2018 6:39:01 AM
Size: 47,382 bytes


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.