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
Compute the optimal width and height for the button given its current images, text, border and theme settings. Does not resize the button.
C
void SftButton_CalcOptimalSize(HWND hwndCtl, int *width, int *height);
C++
void CSftButton::CalcOptimalSize(int *width, int *height);
hwndCtl
The window handle of the button control.
width, height
Pointers to int that receive the optimal width and height in pixels. Either may be NULL if the caller is not interested in that dimension.
CalcOptimalSize is useful when laying out a parent dialog around a button, or for deciding how large to make a button that is about to have its images or text replaced. It is also the computation SftButton uses internally when iAutoSize is not SFTBUTTON_AUTOSIZE_NONE - see Auto-Sizing.
The returned values include the border and internal padding. They are in physical pixels for the button's current monitor DPI; if the button later moves to a different-DPI monitor the optimal values change.
See Also C/C++ API | Auto-Sizing
