ComponentOne VSFlexGrid 8.0
ComboCount Property

Returns the number of items in the editor's combo list.

Syntax

val& = [form!]VSFlexGrid.ComboCount

Remarks

The ComboCount property allows you to customize editing when using drop-down or combo lists. It is valid only while the user is editing a value using a list.

For example, the code below traps the Home key and selects a specific name instead of moving the cursor to the first item on the list. The example also illustrates the use of other related properties, ComboItem and ComboIndex.

Private Sub fg_KeyDownEdit(ByVal Row As Long, _

                                               ByVal Col As Long, _

            KeyCode As Integer, ByVal Shift As Integer)

        Dim i As Long

        If Col = 2 And KeyCode = vbKeyHome Then

            KeyCode = 0 ' eat the key           

                     For i = 0 To fg.ComboCount - 1 ' select "Cedric"

                If fg.ComboItem(i) = "Cedric" Then

                    fg.ComboIndex = i

                    Exit For

                End If

        Next

        End If

    End Sub

Data Type

Long

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback