The new vbAccelerator Site - more VB and .NET Code and Controls
Source Code
2 Common Controls Library &nbsp

Owner Draw ComboBoxEx Control

A more flexible, better version of the VB6 ComboBoxEx control.



NOTE: this code has been superceded by the version at the new site.




Various Owner Draw ComboEx Controls


Download Code
Download the vbAccelerator ComboBoxEx Control only (42kb)
Download the ComboBoxEx Demonstration project (44kb)
Download the ComboBoxEx Control Source and Demonstration project (114kb)

&nbsp Source Code Note &nbsp
&nbsp This OCX is a binary compatible component which works with all other samples. If you compile your own copy of this OCX yourself please make sure you change the name. See disclaimer and license for more details. &nbsp
&nbsp Before you Begin &nbsp
&nbsp All projects require the SSubTmr.DLL component. Make sure you have loaded and registered this before trying any project. &nbsp
&nbsp You will also need the OLEGuids Type Library. Make sure you have loaded and registered this before trying any project. &nbsp

&nbsp
Overview
The Owner Draw ComboBoxEx control is an all VB implementation of the COMCTL32.DLL ComboBoxEx control with additional features borrowed from the Owner Draw Combo and List Box control.

Features
  • Similar programming interface to the standard ComboBox control.
  • AutoComplete built in, with the option of allowing only ListItems to be typed or for any item to be entered.
  • Capable of working as a Drop-Down Combo or a Drop-Down List (no edit portion).
  • Manipulate the size and position of the drop-down portion in response to the RequestDropDownResize event.
  • Works with Microsoft or API ImageLists.
  • Inbuilt styles for rapid development:
    • Drive List
      The control lists all the available drives on the system. This makes a good replacement for the VB DriveComboBox control.
    • Colour Picker
      In this mode the control interprets the ItemData as an RGB colour, and displays it in a similar manner to the colour drop-down lists shown in the VB IDE properties window. Two types are available: a type with text and one with colour boxes only.
    • System Colour Picker
      The same as the colour picker with text option, except the system colours are automatically populated into the control.
    • Font Picker
      In this mode the control is automatically populated with available fonts and a Printer/True-Type indication.
  • Owner-Draw style: In this mode the control raises events to the owner whenever an item needs to be drawn, allowing completely customised combo box implementations to be programmed.


Compared to the Owner Draw Combo List Box
This control shares many features with the Owner-Draw Combo and List Box control. In fact, ComboBoxEx is simply Microsoft's implementation of an Owner Draw Combo for the purposes of drawing Explorer's drive picker combo box. ComboBoxEx only implements the features it strictly has to in order to fulfil that function. That means that it is less flexible than my Owner-Draw Combo and List Box. Notable differences are:
  • ComboBoxEx Only works as a combo box.
  • ComboBoxEx ListItems all have the same height.
  • Extra formatting properties beyond icon and indentation such as text alignment and colour are not provided for.
  • The ComboBoxEx control displays an icon next to the text even in drop-down combo box configuration.
The choice of control to use will depend on whether the extra flexibility or a ListBox configuration is required.

Documentation
Documentation for the vbAccelerator Owner Draw ComboBoxEx control's properties, methods and classes is available as an RTF. This documentation was created with the Active X Documenter.

Click here to download/view the vbalCbEx control method and event documentation



TopBack to top
Source Code - What We're About!Back to Source Code

&nbsp

AboutContributeSend FeedbackPrivacy

Copyright 1998-1999, Steve McMahon ( steve@vbaccelerator.com). All Rights Reserved.
Last updated: 29 May 1999