SftButton/DLL 3.0 - Button Control
SftTree/DLL 8.0 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 4.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 8.0 - Tree Control
SftButton/DLL 3.0 - Button Control
SftTree/DLL 8.0 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 4.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 8.0 - Tree Control
SftTree/NET 2.0 - Tree Control
SftButton/OCX 4.0 is fully Per-Monitor v2 DPI-aware. A button control hosted on a Per-Monitor v2 aware top-level window re-renders automatically when its window moves to a monitor of a different DPI or when the system DPI changes. The control owns the metrics it controls; the caller owns the images and fonts it provides. One opt-in property lets the caller hand the images over to the control as well.
The host application must declare Per-Monitor v2 DPI awareness. This is the single most common reason high-DPI applications do not re-render correctly when moved between monitors of different DPI. Without a Per-Monitor v2 declaration, Windows keeps the process in System-aware mode: the DPI is fixed for the process lifetime, the control does not observe DPI changes, the DPIChanged event is never fired, and high-DPI monitors render at System-DPI sizes stretched by Windows.
Declare Per-Monitor v2 awareness in the host application's manifest, for example:
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness> <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
In a .NET project, this corresponds to selecting Per Monitor V2 for the application's DPI awareness. The DPI property returns the control's current monitor DPI (96 at 100%, 120 at 125%, 144 at 150%, 192 at 200%). If the returned value never changes as the window is dragged between monitors with different scale factors, the host is not in Per-Monitor v2 mode.
When the host is Per-Monitor v2 aware, the control scales the metrics it owns itself on every DPI change without any caller involvement: the border and edge widths, the focus rectangle, the drop-down button width and its arrow, and the internal spacing between the caption and the images.
ImageScaling decides whether the images supplied to the control also scale with DPI. It uses SftButtonScalingConstants:
| Value | Effect |
|---|---|
| scalingSftButtonStretch (default) | Images are scaled by current DPI / 96 using high-quality interpolation, so artwork prepared at 96 DPI keeps its physical size on a high-DPI monitor. |
| scalingSftButtonAsIs | Images are drawn at their native pixel size. Appropriate when the application already supplies artwork prepared for the current scale factor. |
The setting covers every image the application gives the control: the Image1 and Image2 families and the background images, including their hover, pressed and disabled variants.
When the control's monitor DPI changes, the DPIChanged event is fired. The application should re-send a font sized for the new DPI (the control does not own the application's font). If ImageScaling is left at its default of scalingSftButtonStretch, no further action is needed - the control scales the existing images automatically.
