Help Center

CToolbar.CommandToIndexmethod

Retrieves the zero-based index for the button associated with the specified command identifier.

WindowsmethodCToolbar.incdocumented

Syntax

FUNCTION CommandToIndex (BYVAL hToolbar AS HWND, BYVAL idButton AS LONG) AS LONG

Parameters

NameDescription
hToolbarHandle to the toolbar control.
idButtonCommand identifier associated with the button.

Return value

Returns the zero-based index for the button or -1 if the specified command identifier is invalid.

Description

Retrieves the zero-based index for the button associated with the specified command identifier.

Reference

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