				ComboBoxLB

Last changed at 28-may-2001.

Version 2.00



This control is created by Patrick van Olderen.
http://www.home.zonnet.nl/PatrickO/



Changes made:




Added:


Sub's:

============================================================

Public Sub AddItem(ByVal strItem As String)

Add an item/row to the combobox.
i.e. 1 column: strItem = "hello"
i.e. 2 columns: strItem = "hello;1"
i.e. 3 columns: strItem = "hello;yes;1"

The item/row is added at the bottom of the list.

----------------

Public Sub RemoveItem(lngIndex As Long)

Remove an item from the combobox. The first item is 0.
The item is not removed from the table or the query it is based on.

============================================================

Properties:

============================================================

Property Get ComboBoxIsOpen() As Boolean

Returns True when the combobox is open.

============================================================

Property Get ListCount() As Long

Returns the number of items in the list portion of a control.

============================================================

Events:

============================================================

-

============================================================

Bugs Fixed:

 - The boundcolumn had to be an unique number.
   The boundcolumn can also be an unique string now.
   For instance when you have only one column in the combobox filled with strings.

 - When the combobox is open (listbox is visible) and ESC is pressed the key is passed to
   the application. So when a button has the Cancel property set to True, the
   cancel event is triggered.
   It should be eaten by the combobox otherwise the form is closed.

   Solution:
   Workaraound.
   ' check if the combobox is open and cancel the Cancel button
   Debug.Print ComboBoxLB1.ComboBoxIsOpen

   I.E.
   Private Sub cmdClose_Click()
   ' Cancel property is set to True for this button
   
      If ComboBoxLB1.ComboBoxIsOpen Then
         ' do nothing because the combobox is open
      Else
         Unload Me    ' close the form
      End If

   End Sub

 - When the combobox was not filled and you tried to read the Value an error occured.

 - Now it is possible to open the combobox and it's listbox part will come over the edge
   of the form or frame.

 - There was an error in drawing the arrow down in the combobox.
   This was the error: press the left mouse button on the arrow down, keep mouse button
   pressed and move the mouse outside the arrow down area
   click on a textbox that is on the form
   press the left mouse button on the arrow down again, keep mouse button
   pressed and move the mouse outside the arrow down area
   the arrow down stays in pushed position



This control is created by Patrick van Olderen.
http://www.home.zonnet.nl/PatrickO/



Using this control is for your own risk. I do not take any responsibility for harm done using this control.