property ComboBox.FilterForVisible as Boolean
Specifies whether the control's FilterFor field is shown or hidden.

 TypeDescription 
   Boolean A boolean expression that specifies whether the control shows or hides the FilterFor field.  
By default, the FilterForVisible property is false, so the FilterFor field is hidden. Use the FilterForVisible property to display a text box editor in the bottom side of the drop down portion of the control to allow filtering items in a different way. The Description(exFilterForCaption) property specifies the prefix string (Filter For:) being shown in the FilterFor field. The Description(exFilterForTooltip) property specifies the tooltip to be shown when the cursor hovers the FilterFor field. The FilterForBackColor property specifies the FilterFor field background color or appearance, if using EBN technology. The FilterForForeColor property specifies the forecolor for the FilterFor field. The height of the FilterFor field is determined by the control's FilterBarFont property. The control fires the EditChange(-1) event when the user alter the text in the FilterFor field. The -1 parameter indicates the FilterFor field. Use the EditText(-1) property to specify the text being displayed in the FilterFor field. Use the Filter, FilterType and ApplyFilter methods to filter the items in the drop down portion of the control as the user changes the text in the FilterFor field. Use the FilterBarHeight property on 0, to hide the description for the filter being applied. The CTRL + Backspace key removes the characters from start to the position of the cursor in the FilterFor field, while the CTRL + Delete key removes the characters from the position of the caret to the end of the field. The DisplayFilterButton property specifies whether the column's header displays a filter button, which allow filtering on multiple columns.

The following screen shows shows the FilterFor field:

The following VB sample changes the control's filter as soon as the user start typing characters in the FilterFor field:

Private Sub ComboBox1_EditChange(ByVal ColIndex As Long)
    If (ColIndex = -1) Then
        Dim sFilter As String
        With ComboBox1
            sFilter = .EditText(-1)
            .BeginUpdate
            .ClearFilter
            .FilterBarHeight = 0
            If (Len(sFilter) > 0) Then
                With .Columns(0)
                    .FilterType = exPattern
                    .Filter = "*" + sFilter + "*"
                End With
            End If
            .ApplyFilter
            .EndUpdate
        End With
    End If
End Sub

Send comments on this topic.
1999-2017 Exontrol.COM, Software. All rights reserved.