SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
SftButton can automatically resize itself to fit its text and images, re-anchoring to one of nine reference points on its original bounding rectangle. Set iAutoSize on SFTBUTTON_CONTROL to opt in.
| Value | Anchor point | Button grows toward |
|---|---|---|
| SFTBUTTON_AUTOSIZE_NONE (0) | - (disabled) | - |
| SFTBUTTON_AUTOSIZE_TOPLEFT | Top-left corner | Right and down |
| SFTBUTTON_AUTOSIZE_TOPRIGHT | Top-right corner | Left and down |
| SFTBUTTON_AUTOSIZE_BOTTOMLEFT | Bottom-left corner | Right and up |
| SFTBUTTON_AUTOSIZE_BOTTOMRIGHT | Bottom-right corner | Left and up |
| SFTBUTTON_AUTOSIZE_TOPCENTER | Top edge, horizontally centered | Down, growing symmetrically from center |
| SFTBUTTON_AUTOSIZE_BOTTOMCENTER | Bottom edge, horizontally centered | Up, growing symmetrically from center |
| SFTBUTTON_AUTOSIZE_LEFTCENTER | Left edge, vertically centered | Right, growing symmetrically from center |
| SFTBUTTON_AUTOSIZE_RIGHTCENTER | Right edge, vertically centered | Left, growing symmetrically from center |
| SFTBUTTON_AUTOSIZE_CENTER | Original center | Symmetrically in all directions |
The original bounding rectangle is recorded at the moment SFTBUTTON_AUTOSIZE is first set. Subsequent text, image and border changes recompute the optimal size and reposition the button relative to the recorded anchor.
SftButton_CalcOptimalSize returns the optimal width and height without actually resizing the button. Useful for laying out the parent dialog before creating the button, or for computing the size of a future button given candidate text / image content.
If the parent repositions the button (MoveWindow / SetWindowPos), the anchor is updated to match the new rectangle.
