property Grid.CheckImage(State as CheckStateEnum) as Long
Retrieves or sets a value that indicates the image used by checkbox cells.

 TypeDescription 
   State as CheckStateEnum A CheckStateEnum expression that defines the state of the check box being changed. 0 - unchecked, 1 - checked, 2 - partial checked.  
   Long A long expression that indicates the index of the icon used. The last 7 bits in the high significant byte of the long expression indicates the identifier of the skin being used to paint the object. Use the Add method to add new skins to the control. If you need to remove the skin appearance from a part of the control you need to reset the last 7 bits in the high significant byte of the color being applied to the part. If the index is not valid the default icon is used.  

Use CheckImage and RadioImage properties to define icons for radio and check box cells. The CheckImage property defines the index of the icon being used by check boxes. Use the CellHasCheckBox property to assign a checkbox to a cell. Use the CellHasRadioButton property to assign a radio button to a cell. Use the CellImage or CellImages property to assign one or multiple icons to a cell. Use the CellPicture property to assign a picture to a cell. Use the CellStateChanged event to notify your application when the cell's state is changed. Use the PartialCheck property to allow partial check feature within the column. Use the Images method to load icons at runtime.

The following VB sample defines icons for the cells of check box type:

With Grid1
    .BeginUpdate
        .Columns.Add "Radio"
        For i = 0 To 2
            Dim h As HITEM
            h = .Items.AddItem("Option " & i)
            .Items.CellHasCheckBox(h) = True
            .Items.CellState(h) = i Mod 2
        Next
        .CheckImage(0) = 1
        .CheckImage(1) = 3
    .EndUpdate
End With

The following C++ sample changes the default appearance for check boxes:

The following C# sample changes the default appearance for check boxes:

The following VB.NET sample changes the default appearance for check boxes:

The following VFP sample changes the default appearance for check boxes:

The following template can be placed on the control's Template page:

 


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