|SmartCombo Control 1.0|
Visual Data Solution
Quick Facts: SmartCombo is a COM control for Microsoft Visual Basic, Visual C++, and any other Windows development environments that support COM controls. It allows for the quick creation of custom DropDown ComboBoxes.
Pros: Simple to use; extremely powerful; allows for complex functionality while minimizing screen space.
Cons: Could benefit from improved documentation and the addition of a few useful properties and events.
Visual Data's SmartCombo ActiveX control lets you create customized combo boxes of often-useful complexity. The methods for using the control are well thought out, although the documentation could use some work. In this review, I'll show you the basics of using SmartCombo and discuss the more advanced features.
The control consists of several "buttons." The standard down-arrow button is visible by default, but you can hide and show any button at either design or runtime. Each button has an associated constant that's defined automatically when you add the SmartCombo component reference. All the buttons raise a ButtonClick event and pass the constant for the button that was clicked in a ButtonID parameter to a shared handler. You would normally create a Case statement to respond to a click on a particular button by checking the ButtonID parameter value passed to the ButtonClick event handler. For example:
Private Sub SmartCombo1_ButtonClick( _
ByVal ButtonID As VDSCOMBOLibCtl.vdsButtonID, _
ByVal SpinningEnded As Boolean)
Select Case ButtonID
' handle the click on each visible button
Unlike in many other ActiveX controlsincluding some of Microsoft'sthese defined constant names are well-chosen and easy to remember. SmartCombo doesn't accept a list of strings and associated ItemData like the standard ComboBox control does; instead, you assign the dropdown portion using a PictureBox or other control. That scheme makes the dropdown portion of SmartCombo entirely yours to control, using standard VB event handlers and code to build interactivity in the dropdown portion.
However, you do have to write the code to control the dropdown; it's not as automatic as creating a standard ComboBox. For example, you have to tell the control when to display the dropdown portion, and (for the most part) when to hide it, although the control hides the dropdown portion automatically if the user switches the focus to another control or form or takes any action that closes the window. Fortunately, the control's properties and methods make building relatively complicated controls extremely easy.