winzip icon

CheckBoxCombo 1.4 – Updated on 03-08-2018 - (A professional and effective Multi-select ComboBox)

Submitted on: 8/6/2018 3:52:54 PM
By: PGB Prasanna 
Level: Intermediate
User Rating: By 6 Users
Compatibility: VB 6.0
Views: 7745

CheckBoxCombo is a general-purpose Multi-select ComboBox User Control designed for Visual Basic. It differs from the conventional ComboBox behavior by allowing user to select one or more items from its drop-down list. CheckBoxCombo greately integrates the existing power of standard VB controls (ComboBox and ListBox) to provide its powerful features and can be easily integrated into any sort of Windows GUI project in VB. Sure, it's a must to have companion in your standard VB Toolbox.

Why is CheckBoxCombo?

The conventional ComboBox control in VB allows you to select only one item at a time from its drop-down list. It cannot be used in situations where you need to select more than one item at a time. For this particular purpose you should use a multi-choice enabled ListBox, which is all right, if you have enough space on your interface/form. But what if you have a very limited space to place the ListBox with dozens of items; may be closer to the bottom of your interface? CheckBoxCombo is a great replacement in such situations where you need to save the space on your UI (User Interface), with its great dynamic features.

CheckBoxCombo is also elegant in providing multiple inputs to SQL queries in database programming.

Further, CheckBoxCombo allows you to set any of its properties even at run-time, which is not even allowed by the traditional ComboBox control. One such property is [sorted], which you can dynamically set the sorting at run-time. This gives you a great flexibility in using the user control simply by overriding the design-time settings as you wish. CheckBoxCombo also exposes some methods to support less coding when working with it.

Its [OnListSearch] property helps user to search and select any item in the list easily.

The user control greatly supports for modern visual styles since it integrates the existing VB controls which support visual styles.

With CheckBoxCombo's professional features and familiarity in use due to nearly familiar syntax it provides, you will more feel it like a must to have control in your standard VB Toolbox.

Outstanding features of CheckBoxCombo:

  • Professional, effective and ready-to-use design for any sort of Windows GUI project in VB
  • No dependent modules, extremely easy to integrate as a single module
  • Extremely easy to use
  • Ability to setup all supported properties even at run-time
  • Very smooth and faster operation, even with thousands of items
  • Dynamic sorting on ascending or descending, supporting thousands of items
  • Supports for different longest-text-display modes
  • Search-and-select feature for items
  • Exposes methods to support less coding
  • Highly flexible and configurable
  • Powerful and reliable on all supported operations
  • User friendly and familiar syntax
  • Supports for all flavors of Windows from Windows XP with visual styles
  • ActiveX support (VB/VBA)

Note: Please go through the User Documentation provided with the download and study the Demo Application, so that you may get a clear idea about CheckBoxCombo.

Comments, suggestions are greatly welcome...

winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net

Other 11 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

6/26/2018 7:24:40 AMSalvo Cortesiano

Excellent code and well-documented my friend! This control must never be lacking in a programmer's toolbox :) Keep moving!
(If this comment was disrespectful, please report it.)

6/26/2018 8:30:24 AMPGB Prasanna

Thanks for the comment Salvo...
(If this comment was disrespectful, please report it.)

6/27/2018 7:21:40 AMPGB Prasanna

Updated on 27-06-2018: The OCX version included, several changes to the documentation done and, a bug fixed in property initialization.
(If this comment was disrespectful, please report it.)

6/27/2018 2:21:24 PMLorin

Missing features:
1) AddItem needs an optional argument: Selected (True/False) so the checkbox can be set while adding.
2) AddItem should return the Index where the item was added or inserted or -1 if failure. Or a method NewItem like a ListBox.
3) FindItem should return the Listindex or -1 if not found.
4) RemoveItem Index should be a Variant (plus a little coding) so either the items string or the Index can be used to remove items. If is not a number, call your FindItem to return an Index. Ditto for other methods.

NOTE: comma is a poor delimiter as a default, vbTab is much better.

(If this comment was disrespectful, please report it.)

6/27/2018 4:52:35 PMPGB Prasanna

@Lorin, nice suggestions, I will look into them. Thanks...
(If this comment was disrespectful, please report it.)

6/27/2018 5:13:44 PMLorin

Glad to here that.
To make your box more robust, make the ListBox a virtual listbox with a scrollable window into a memory or disk file data. hat way there will be no limitation on the ListCount up to say 2G. Takes more work to implement but this is what is needed these days with amount of data we must handle.

(If this comment was disrespectful, please report it.)

6/27/2018 9:11:38 PMPGB Prasanna

I agree, but I wanted to do this in a simple way similar to a control like ComboBox/ListBox in VB toolbox, with the idea to allow user to select multiple items, that we cannot do with the normal ComboBox. The scope of this project was exactly aimed to most of the general cases in VB Classic programming like we normally do with the standard VB toolbox. And from the usability perspective, check lists and combos with more than a couple hundred items are going to be a real pain. So the limitations of this control should be addressed in that sense.
Anyway, thanks for the great idea for a sophisticated future version.
(If this comment was disrespectful, please report it.)

6/29/2018 9:02:20 PMPGB Prasanna

What’s new in 1.1 version released on 30-06-2018?
• Syntax changes done for the methods of AddItem, RemoveItem, and FindItem for more flexibility in use, as suggested by Lorin.
• The DelimiterConcat property introduced. Now your desired delimiter is much safe and hardly possible for collision.
• The CBCUpdate property and CBCUpdateCompleted event introduced for working with large number of list items, which leads optimized results.
• The Change event in version 1.0 changed to ItemCheck
• Several bug fixed, and optimizations done related to LongestTextDisplayMode property.
• User documentation updated with all the changes.

Note: v1.1 is much stable than 1.0.

(If this comment was disrespectful, please report it.)

7/4/2018 6:56:41 AMEddie Bole

Thanks for the great program and the update Prasanna. I was wondering, is there a way of adding 2 checkboxes for each row. I know that it was done for a net version on planet source code but I have not come across it for vb6. Regards Eddie.
(If this comment was disrespectful, please report it.)

7/5/2018 5:51:55 PMPGB Prasanna

Thanks for the nice comment...
(If this comment was disrespectful, please report it.)

7/5/2018 5:56:02 PMPGB Prasanna

CheckBoxCombo 1.2 (05-07-2018)
• FillList method included, now the list can be filled by a String/Variant type array
• Scrollbar issue fixed
• Enhanced the mouse-click support for selecting/unselecting items in the list,
now mouse-click supports anywhere on the list item for quick selections
• Several minor bug fixed and optimizations done
• User Documentation updated
(If this comment was disrespectful, please report it.)

7/15/2018 5:23:13 PMPGB Prasanna

CheckBoxCombo 1.3 (15-07-2018)
• Made changes to ActiveX version to be full compatible with VBA.
Now it’s possible to use CheckBoxCombo even in UserForms, Spreadsheets,
Documents, etc. in Microsoft Office 32-bit editions
• Optimized hooking mechanism
• Fixed issues with MDI
• Fixed issues related to Display Monitor
• Fixed issues with mouse-wheel and scrollbars
• Made minor changes to documentation
(If this comment was disrespectful, please report it.)

7/16/2018 3:21:20 AMJJ Banks

Voting is as important as comments.
Although I do not care about voting on my programs, many other programmers depend on it. thus, VOTE

(If this comment was disrespectful, please report it.)

7/16/2018 6:46:22 AMPGB Prasanna

@ JJ,
Thank you for your vote and comment. If someone is benefited from this in whatever manner, that is the real VOTE.
(If this comment was disrespectful, please report it.)

7/18/2018 4:17:02 AMPGB Prasanna

Revision update 1.3.2 (18-07-2018)
• Made internal improvements in hooking mechanism
• Bugfixes in ActiveX
(If this comment was disrespectful, please report it.)

7/23/2018 9:11:42 AMPGB Prasanna

Revision update 1.3.3 (23-07-2018)
• Fixed a minor bug when displaying the drop-down list
(Translucent rectangle appearance issue on the screen
due to some visual-effect settings of the OS)
(If this comment was disrespectful, please report it.)

8/3/2018 4:33:36 PMPGB Prasanna

CheckBoxCombo 1.4 (03-08-2018)

• Newly introduced method. Now, CheckBoxCombo can be directly populated from a Database
with multiple options for greater flexibility
• Added missing property, [NewItem]
• Changed methods as properties
• Introduced an optional parameter of type Boolean, {DelimiterConcatIncluded} to be used with the read-only properties of
[SelItem, SelItemData, SelIndex, Text]. Now, the values of them can be returned excluding the DelimiterConcat character
used with the [DelimiterConcat] property
• Introduced an additional option {None} with the [DelimiterConcat] property
• Altered method as
• Fixed several minor bugs
• Updated User Documentation
• Released database demonstration application
(If this comment was disrespectful, please report it.)


Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)

To post feedback, first please login.