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.
| State | When active | Fields used |
|---|---|---|
| Normal | The 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 |
| Hover | The mouse is over the button and hover detection fires (see Hover Detection). | Picture1Hover, Picture2Hover, PictureBGHover, colorBgHover (or colorBgHoverStart / colorBgHoverEnd) |
| Pressed | The 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 |
| Disabled | The button has been disabled through WS_DISABLED / EnableWindow. | Picture1Disabled, Picture2Disabled, PictureBGDisabled, colorFgGrayed |
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 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.
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.