HotVB - Microsoft VB5/CCE ActiveX Controls from
WinResources Computing, Inc.
This Control, the
Winner of the Tech Web / Microsoft VB 5.0 CCE Control
Challange, was created by Robert Kubelka, VP -
Technology, at WinResources Computing, Inc. WinResources
is a custom application development company. The
following are Bob's comments on the control. The goal in creating the Vertical Menu control was an exercise to see if VB5 - CCE could produce a control with the look and feel of the Outlook Bar in Microsoft's Outlook '97. We think the control is almost an exact duplicate as there are just a few very minor areas where you can tell -- if you look very, very closely! (Note that the Vertical Menu control uses only icons that are 32 x 32 pixels in size -- it does not use small icons as can the Outlook Bar. The project makes use of classes and collections. There is a class/collection of Menus filled with Menu objects. There is a class/collection of Menu Items for each Menu and this is filled with Menu Items. Lastly, there is an Arrow Class for the up/down arrows, when needed. The control is completely owner-drawn, except for the icons, of cource. And it works in a VB5 project, in a browser or in any other tool that uses ActiveX technology. We'd say that VB5 came thru with flying colors! Feel free to download the source code and play with it all you want. And please visit us at www.winresources.com. We are always looking for a few good programmers. |
A few notes for programmers who might want to use it.
In the source code download, there is a sample VB5 project in the control's project files which shows how everything works. Note that this sample sets up the control at design time. But there is no reason not to modify the control at run-time. You could even implement drag and drop with it!
There are two ways to load icons into the control, depending on the container. For use in VB5, use the MenuItemIcon property. This allows the icon to be saved in its "property bag". However, this does not work on the Internet because controls don't have a property bag there. Instead, use the MenuItemPictureURL which loads an icon from a web site. Unfortunately, because the icons are loaded depending on the current menu and current menu item, these parameters must be coded manually; Front Page just refuses to do this for you. Not really very much work, but once done, don't go back and look at the ActiveX property page because Front Page will delete your parameters. Also, if using the ActiveX Control Pad, don't assign any icons in the property page as it tries to write all properties as binary. This doesn't work for all these icons -- you'll end up GPF'ing so you still must enter the parameters manually.
Windows API calls are used extensively. On some machines that don't have very fast video cards, the menus may be fairly slow in opening; I've noticed this characteristic only on laptops. The menus are "BitBlt" a pixel at a time to create the menu movement and all this BitBlt'ing may slow the menu movement down on some machines. There is a conditional constant "USE_WING" that when set to -1 uses Microsoft's WinG API WingBitBlt rather than the standard BitBlt. This should speed things up a bit. Or else you can modify the code so that the BitBlt's are not for every pixel - maybe every 4th or 8th pixel. Have fun experimenting.
You may freely use this control, both as is or modified. However, the control is copywrited by WinResource Computing, Inc. and if you do use it in a project, please give credit for the control in your About box. You may not modify the code to produce your version of the control and then sell it.
Lastly, I hope some of you learn from this code. I love to look at other's code and learn from it. And if anyone can improve on it or has any comments at all, please send me mail at rkubelka@winresources.com. Have fun!!
Bob Kubelka, VP - Technology
WinResources Computing, Inc.
140 Marine View Ave, Suite 220
Solana Beach, CA 92075
(Yes, we are a mile from the beach in San Diego County and you can go surfing at lunch!)