Checked, Hidden, Indeterminate, Pressed Properties (Button)

Purpose

Return or set the Button object state.

Syntax

Button.Checked [ = Boolean ]

Button.Hidden [ = Boolean ]

Button.Indeterminate [ = Boolean ]

Button.Pressed [ = Boolean ]

Description

Checked [ = ? ] Returns or sets a Boolean that determines the checked state of the button.
Hidden [ = ? ] Returns or sets a Boolean that determines the visibility of the button.
Indeterminate [ = ? ] Returns or sets a Boolean that determines the indeterminate state of the button (dimmed background).
Pressed [ = ? ] Returns or sets a Boolean that determines the pressed state of the button.

Example

Ocx ToolBar tb

tb.Add , , "Checked", 1 : tb.Add , , "Hide" : tb.Add , , "Indeterminate" : tb.Add , , "Pressed"

tb(1).Checked = True          // Sets the button as Checked.  Click to uncheck

tb(3).Indeterminate = True

tb(4).Pressed = True          // Highlights the button until clicked.

Do : Sleep : Until Me Is Nothing

 

Sub tb_ButtonClick(Btn As Button)

Select Btn.Index

Case 1

' Btn.Caption = (Btn.Checked ? "Checked" : "Unchecked")  // Returns 'Not implemented' error

Case 2

Btn.Hidden = True

EndSelect

EndSub

Remarks

An indeterminate state is a combination of two or more states. For example, if the user selects text in a RichEdit textbox, and some of the text is italicized, the button that represents italicized text cannot be either checked or unchecked; the text in the selection is both. To signify this indeterminate state, set the Indeterminate property to True. This dithers the image on the button to create a third state of the button's image.

See Also

Button, ToolBar

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