Toolbox window template * VB 5.0 Form template, April 2002

Most programs need tool windows at some point, to set the odd user setting for example, or as a fancy Line Input window. So I've created a nice one which uses the Deluxe Button control (evaluation version of the OCX is included in the download).

Here is a screen shot:

The tool window is built on a very subdued "steel" gradient background. The actual background looks a lot better than this gif picture can accomplish! On it are basically just an OK and a Cancel button. The Caption bar is another Deluxe Button with the Panel style, which uses the Active Title bar colour and the Inactive Title bar colour from Windows. And it has a tiny Close button. The OK button is set as the Default button, the Cancel button is set as the default Cancel button. The caption bar allows you to drag the window across the screen.
The buttons are set to use the Faint border style, which lights up (like the Cancel button in the picture) when the mouse moves over it. See also the
Button control page.

How to use the code
Download the zip file which includes all the VB 5.0 code, as well as trial version of the Button control. Unpack it to a subdirectory, and run it. If you have not previously installed the OCX, use RegSvr32 to do so, or open a new project in VB, and add the button control to that project. VB will register the control for you at that moment.

The hack
One thing I haven't figured out: the custom title bar means that the form has no VB "Caption" property. This prevents the form from being shown in the Task Bar - or if it is shown, it is just an empty square. For properties windows and tool windows etc. this is no great problem, but the nice title bar solution cannot be used for a "normal" form which should be displayed in the Task Bar of Windows. If you have any tips, I'd appreciate an email!
On this form I've solved it by adding an empty "shadow" form, which is only used to supply the Windows task bar with an icon and a form caption. You can remove this if you don't like it or don't use it.

This VB 5.0 form template is freeware. The included Deluxe Button OCX is a trial version which has no time limit, but does show a short message box.
Download the VB 5.0 Tool Window Form Template (63kB including custom control trial version)


Home * Software * News * Links * Mail