Help Center

CButton.SetTextMarginmethod

Sets the margins for drawing text in a button control.

WindowsmethodCButton.incdocumented

Syntax

FUNCTION SetTextMargin (BYVAL hButton AS HWND, BYVAL pMargin AS RECT PTR) AS BOOLEAN
FUNCTION SetTextMargin (BYVAL hButton AS HWND, BYREF margin AS RECT) AS BOOLEAN
FUNCTION SetTextMargin (BYVAL hButton AS HWND, BYVAL nLeft AS LONG, BYVAL nTop AS LONG, BYVAL nRight AS LONG, BYVAL nBottom AS LONG) AS BOOLEAN

Parameters

NameDescription
hButtonThe handle of the button control.
pMarginA pointer to a RECT structure that specifies the margins to use for drawing text.
marginA RECT structure that specifies the margins to use for drawing text.
nLeftThe left margin.
nTopThe top margin.
nRightThe right margin.
nBottomThe bottom margin.

Return value

If the message succeeds, it returns TRUE. Otherwise it returns FALSE.

Description

Sets the margins used to draw text in a button control.

Remarks

To use this message, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.

Reference

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