Help Center

CButton.SetCheckmethod

Sets the check state of a radio button or check box.

WindowsmethodCButton.incdocumented

Syntax

SUB SetCheck (BYVAL hButton AS HWND, BYVAL checkState AS LONG)

Parameters

NameDescription
BST_CHECKEDSets the button state to checked.
BST_INDETERMINATESets the button state to grayed, indicating an indeterminate state. Use this value only if the button has the BS_3STATE or BS_AUTO3STATE style.
BST_UNCHECKEDSets the button state to cleared.

Return value

This message always returns zero.

Description

Sets the check state of a radio button or check box.

Remarks

The BM_SETCHECK message has no effect on push buttons.

Example

CButton.SetCheck(hButton, BST_CHECKED)

Reference

  • Include file CButton.inc
  • Defined in AfxNova/CButton.inc:313
  • Documented in Windows/WIndows Controls/CButton Class.md
  • Topic: CButton Class