How to implement custom sizing routines for window which borders are not natively sizeable?
e.g. a form with BorderStyle
set to bsToolWindow
How to implement custom sizing routines for window which borders are not natively sizeable?
e.g. a form with BorderStyle
set to bsToolWindow
Here a customized form-class with implemented non-sizeable borders sizing and possibility to disable sizing for specified edges. Also it supports double clicks on borders to toggle between two rectangle-boundaries:
AutoSizeRect
to values of which form sides getting moved on dblclick andSavedSizeRect
into which values form side coordinates saved before changing. SoAutoSizeRect
could be setted to some area of the screen at a run-time to give user ability to swap border-side's coords between specified area and current BoundsRect. Very convenient for all kinds of palette-windows (aka ToolWindows). Best combined with custom sticking/aligning.DisabledSizingEdges
property is a set of edges which will be turned off (e.g.DisabledSizingEdges:=[akLeft,akTop];
will turn off sizing for Left-side, Top-side, LeftBottom-corner, LeftTop-corner & TopRight-corner)P.S. actually one can create form with
BorderStyle
set tobsNone
and setBorderWidth
higher than zero to achieve sizing via inner borders: