WinStyle, PushLike, ThreeState, Value Properties

Purpose

WinStyle returns or sets the window style of a Command, Option, and CheckBox.

PushLike returns or sets the pushed style state of a Command, Option, or CheckBox.

ThreeState returns or sets the BS_3STATE of a CheckBox.

Value returns or sets the state of the control.

Syntax

object.WinStyle [ = value ]

object.PushLike [ = boolean ]

object.ThreeState [ = boolean ]

object.Value [ = long ]

object:Ocx object

Description

Returns or sets the actual windows style of the control. For Command, Option, and CheckBox controls the WS_* window style API constants and the BS_* button styles can be used.

The PushLike property sets the BS_PUSHLIKE style and makes a button (such as a check box, three-state check box, or radio button) look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked.

The ThreeState property sets the BS_3STATE button style and creates a check box that can be grayed as well as checked or unchecked. Use the grayed state to show that the state of the check box is not determined.

The Value property can have the following values:

- CheckBox control - 0 is Unchecked (default), 1 is Checked, and 2 is Grayed (dimmed).

- Command control - 1 indicates the button is chosen; 0 (default) indicates the button isn't chosen. Setting the Value property to 1 in code invokes the button's Click event.

- Option control - 1 indicates the button is selected; 0 (default) indicates the button isn't selected

Example

Ocx Command cmd = "This is a"#10"Multiline Button", 10, 10, 140, 40 : cmd.WinStyle = cmd.WinStyle | BS_MULTILINE

Ocx CheckBox chk = "This is a 3-State CheckBox", 10, 60, 200, 14 : chk.ThreeState = True : chk.Value = 2

Ocx Option opt1 = "This is a normal Option control", 10, 90, 200, 14 : .Value = 1

Ocx Option opt2 = "This is a PushLike Option control", 10, 105, 200, 22 : opt2.PushLike = True

Do : Sleep : Until Me Is Nothing

Remarks

Be careful, changing window styles is not always without errors.

See Also

Command, CheckBox, Option

{Created by Sjouke Hamstra; Last updated: 25/10/2014 by James Gaite}