HeaderPane
Main
Hide

SftButton/DLL 3.0 - Button Control

Share Link
Print

Button States

A SftButton control is always in one of four rendering states. The state selects which set of per-state fields on SFTBUTTON_CONTROL the control draws from.

StateWhen activeFields used
NormalThe default state. The mouse is not over the button, the button is not being held down, and the button is enabled.Picture1, Picture2, PictureBG, colorBg (or colorBgStart / colorBgEnd), colorFg
HoverThe mouse is over the button and hover detection fires (see Hover Detection).Picture1Hover, Picture2Hover, PictureBGHover, colorBgHover (or colorBgHoverStart / colorBgHoverEnd)
PressedThe user is holding the primary mouse button down over the button, or the button is in its toggle-pressed state (fToggle and fPressed both TRUE).Picture1Pressed, Picture2Pressed, PictureBGPressed, colorBgPressed, colorFgPressed
DisabledThe button has been disabled through WS_DISABLED / EnableWindow.Picture1Disabled, Picture2Disabled, PictureBGDisabled, colorFgGrayed

Fallback

If a per-state image is not set, the control falls back to the matching field from the normal state. That way you only need to populate Hover / Pressed / Disabled variants when you want them to differ from Normal. Text uses a single SFT_TEXT field that applies to every state - colorFg / colorFgPressed / colorFgGrayed provide the per-state text colors.

Focus

Focus is orthogonal to the four states above. A focused button uses the colorBgFocus (or colorBgFocusStart / colorBgFocusEnd) gradient when no other state overrides it. The focus rectangle is drawn on top regardless of state, unless fHideFocus is TRUE.

Dark mode and high contrast

The four-state model is unchanged in dark mode and high contrast - the same per-state pictures are drawn. Caller-supplied colors are honored in dark mode and overridden by the system palette in high contrast. See Dark Mode and High Contrast.


Last Updated 04/25/2026 - (email)
© 2026 Softel vdm, Inc.