Dela via


Style Property for Visual Basic 6.0 Users

The procedures for displaying images for Visual Basic 6.0 CommandButton, CheckBox, and OptionButton controls differ from those used in Visual Basic 2008.

Conceptual Differences

In Visual Basic 6.0, setting the Style property of a CommandButton, CheckBox, or OptionButton control to 1 – Graphical enables the control to display images. The Picture, DownPicture, and DisabledPicture properties assign images to be displayed in response to state changes. For example, when a CheckBox control is checked, the DownPicture image is displayed; if the CheckBox control is disabled, the DisabledPicture image is displayed.

Visual Basic 2008 no longer supports the Style, Picture, DownPicture, and DisabledPicture properties. The Style property is no longer necessary: Assigning a picture to the Image property has the same effect as setting the Style property to Graphical. The Picture property is replaced by the Image property. The functionality of the DownPicture and DisabledPicture properties can be emulated using an ImageList control that contains multiple images.

Upgrade Notes

When you upgrade an application that has the Style property set to 1 – Graphical, the Appearance property of the upgraded control is set to Button, and any image assigned to the Picture property at design time is assigned to the upgraded control's Image property.

If the DownPicture or DisabledPicture properties were set at design time or at run time, you need to modify your upgraded application to use an ImageList control. For more information, see How to: Emulate a Visual Basic 6.0 Tri-State Control in an Upgraded Application.

See Also

Tasks

How to: Emulate a Visual Basic 6.0 Tri-State Control in an Upgraded Application

Concepts

CheckBox Control for Visual Basic 6.0 Users

CommandButton Control for Visual Basic 6.0 Users

OptionButton Control for Visual Basic 6.0 Users

OptionButton Control for Visual Basic 6.0 Users