I have some tool-panels made via forms with bsSizeToolWin borders, i have custom handling of window-movement and custom routines for sticking/aligning tool-panels with borders of main form (almost like docking functionality), but the problem that with bsSizeToolWin border-style i have all the corners/sides of border sizeable.
Is it possible to make only one specific border-side sizeable? (e.g. when tool-panel sticked to left border of main form i want only right border of panel sizeable, cuz top and bottom coords of panel getting aligned according to height of client area of main form and left coord sticked to right border of main form)
From a visual standpoint, by default if a window has sizable borders then all edges are drawn sizable, otherwise none of them are, there is no in-between as the Win32 API has no concept of per-edge border styles, only whole-window border styles. If you want the various borders to look different, you would likely have to custom-draw the borders manually by handling the
WM_NCCALCSIZEandWM_NCPAINTmessages directly.From a functional standpoint, it is fairly easy to prevent the user from resizing the window on specific edges. The simplest way is to have the panel handle the
WM_NCHITTESTmessage. Give the panel normal sizing borders (custom drawn if desired), and then have it pass any receivedWM_NCHITTESTmessage to the default handler first, and then adjust the result as needed. The benefit of this approach is that the OS will not allow the user to grab any edge that is reported asHTBORDER(non-sizable border), and there will be no visual feedback that the edge is resizable (even if it really is).For instance, let's use your panel-aligned-on-the-left example. If the default handler returns either
HTBOTTOM,HTBOTTOMLEFT,HTLEFT,HTTOPLEFT, orHTTOP, returnHTBORDERinstead. If the default handler returnsHTBOTTOMRIGHTorHTTOPRIGHT, returnHTRIGHTinstead. Otherwise return whatever the default handler returned.Adjust the values as needed based on which edge of your Panel you want to be sizable.
For example:
Alternatively: