VB6 Tutorial 24: OptionButton and CheckBox, Part 2

Posted On 2018-04-07 by VB6Boy
Keywords:
Tags: VB6 Tutorials Windows
Views: 31

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


Looking for the more of the VB6 Tutorial? Here is the tutorial index.

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.

Looking for the more of the VB6 Tutorial? Here is the tutorial index.


About the Author

VB6Boy has posted a total of 71 articles.


Comments On This Post

No comments on this post yet!


Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.


Your IP address is:23.20.165.182

Before you can post, you need to prove you are human. If you log in, this test goes away.




Code Links