vbpslogo2.gif (19593 bytes)
Brad's VB-32 Programs & Samples

Posted: 04/22/99, last update: 04/22/99

Home

SBPanelSizer: Shows how statusbar panels can be sized like splitter windows

Ever wanted to use a statusbar (a real one, VB's, or even the CCRP Statusbar) and didn't have enough horizontal window real estate to display the status text? Well, here's a new solution, allow each panel of the statusbar to be sized just like it had its very own vertical splitter bar...

What we do in the demo is first subclass the target statusbar, allowing us to receive and respond to its mouse messages. The coordinates of the all of the statusbar's vertical panel dividers are then obtained. When the WM_SETCURSOR window message is received and the mouse crosses over one of the panel dividers, the mouse pointer is changed to the horizontal sizing cursor ("<--->"). When the subclassing procedure receives the WM_LBUTTONDOWN message and subsequent WM_MOUSEMOVE messages, the panels on either side of the divider the mouse is over are continually resized with the statusbar's SB_SETPARTS message. Panel sizing is completed on receipt of the WM_LBUTTONUP message.

And we went the whole nine on this one, and implemented the code as an COM server (ActiveX DLL). The project's code can either be compiled into a DLL, or added directly to a project.

To aid in VB IDE subclassing development, the "Debug Object for AddressOf Subclassing" (Dbgwproc.dll) found at the VB owner's area on the MS web site is used by the project and is included in the zip. The DLL must be registered and referenced by the project for things to work correctly.

Download sbpanelsizer.zip (22kb)