Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

ItemImageLeaf Property, SftTreeItems Object

Defines the default graphic used to display a leaf item's item image.

Syntax

Get

VB.NETrefImageObj = object.ItemImageLeaf As SftPictureObject
VBSet refImageObj = object.ItemImageLeaf As SftPictureObject
C#.NETSftPictureObject refImageObj = object.ItemImageLeaf;
VC++ISftPictureObject* refImageObj = object->ItemImageLeaf;
ISftPictureObject* refImageObj = object->GetItemImageLeaf();
CHRESULT object->get_ItemImageLeaf(ISftPictureObject** refImageObj);

Put

VB.NETobject.ItemImageLeaf = refImageObj As SftPictureObject
VBobject.ItemImageLeaf = refImageObj As SftPictureObject
C#.NETSftPictureObject object.ItemImageLeaf = refImageObj;
VC++ISftPictureObject* object->ItemImageLeaf = refImageObj;
void object->PutItemImageLeaf(ISftPictureObject* refImageObj);
CHRESULT object->put_ItemImageLeaf(ISftPictureObject* refImageObj);

object

A SftTreeItems object.

refImageObj

Defines the default graphic used to display a leaf item's item image.

Comments

The ItemImageLeaf property defines the default graphic used to display a leaf item's item image.

The ItemPictureLeaf property is used to define the default item graphic displayed for an item which doesn't have any dependents. Item graphics are not shown until the properties Items.ItemImageExpandable, Items.ItemImageExpanded and Items.ItemImageLeaf define valid graphics.

Sample bitmaps can be found in the directory \Program Files\Softelvdm\SftTree OCX 7.5\Images. E.g., ItemLeaf.bmp and ItemLeaf2.bmp contain suitable sample images for the ItemImageExpanded property.

When using fixed height items (see Items.Style), all graphics used in a tree control as Item.Image, Items.ItemImageExpandable, Items.ItemImageExpanded and Items.ItemImageLeaf properties at the same time must be the same size (height and width). The dimensions of the graphics are used to calculate the minimum dimension for items, so graphics used as item graphics are never clipped vertically. To change the item graphic size, all item graphics must be removed first using the Items.ClearItemImages method.

When using variable height items (see Items.Style), the graphics used can be of varying size. The item height is adjusted automatically, so graphics are never clipped vertically.

If an item is disabled (see Item.Enabled property), the graphic is drawn in a "grayed" fashion, if it is based on a bitmap. Other image types, like color samples, .NET image objects, etc., must be explicitly replaced with a grayed image if a different rendering of a disabled image is desired.

The ItemPictureLeaf property can be set to the value Nothing (NULL). Item graphics are then no longer displayed. The Item.Image properties remain unchanged.

The Items.ItemImageAlign property can be used to align item graphics on lower levels with higher level cells.

The VAlignStyle property can be used to define the vertical alignment of item graphics.

Examples

VB.NET

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AxSftTree1.BulkUpdate = True

        ' set default item graphic.  This can also be done at design time
        AxSftTree1.Items.ItemImageExpandable.SetImageListH(ItemImageList.Handle.ToInt64(), 0)
        AxSftTree1.Items.ItemImageExpanded.SetImageListH(ItemImageList.Handle.ToInt64(), 1)
        AxSftTree1.Items.ItemImageLeaf.SetImageListH(ItemImageList.Handle.ToInt64(), 2)

        ' set the column header sort indicators
        AxSftTree1.Headers.SortIndicators = SftTreeHeaderSortIndicatorsConstants.headerSortIndicatorsSftTreeAuto
        AxSftTree1.get_Header(0).SortIndicator = SftTreeSortIndicatorConstants.sortIndicatorSftTreeAscending

        Dim R As Random
        R = New Random()

VB6

    Randomize
    With SftTree1
        ' Mass-Update
        .BulkUpdate = True
        ' set default item graphic.  This can also be done at design time
        Set .Items.ItemImageExpandable.Picture = BookClosed.Picture
        Set .Items.ItemImageExpanded.Picture = BookOpen.Picture
        Set .Items.ItemImageLeaf.Picture = Topic.Picture
        ' set the column header sort indicators
        SftTree1.Headers.SortIndicators = headerSortIndicatorsSftTreeAuto
        SftTree1.Header(0).SortIndicator = sortIndicatorSftTreeAscending
        ' set the cell font for books
        Set CellFont = Font
        CellFont.Bold = True
        ' Add all available options
        For Bk = 1 To 4

C#

        private void Form1_Load(object sender, System.EventArgs e) {

            axSftTree1.BulkUpdate = true;

            // set default item graphic.  This can also be done at design time
            axSftTree1.Items.ItemImageExpandable.SetImageListH((long)itemImageList.Handle, 0);
            axSftTree1.Items.ItemImageExpanded.SetImageListH((long)itemImageList.Handle, 1);
            axSftTree1.Items.ItemImageLeaf.SetImageListH((long)itemImageList.Handle, 2);

            // set the column header sort indicators
            axSftTree1.Headers.SortIndicators = SftTreeHeaderSortIndicatorsConstants.headerSortIndicatorsSftTreeAuto;
            axSftTree1.get_Header(0).SortIndicator = SftTreeSortIndicatorConstants.sortIndicatorSftTreeAscending;

            Random random = new Random();

            // set the cell font for books

C++

    // random numbers
    srand(0);

    m_vTree->BulkUpdate = VARIANT_TRUE; // Mass update

    // set default item graphic.  This can also be done at design time
    m_vTree->Items->ItemImageExpandable->PutBitmapHandle((OLE_HANDLE)(HBITMAP)m_BookClosed);
    m_vTree->Items->ItemImageExpanded->PutBitmapHandle((OLE_HANDLE)(HBITMAP)m_BookOpen);
    m_vTree->Items->ItemImageLeaf->PutBitmapHandle((OLE_HANDLE)(HBITMAP)m_Topic);

    // set the column header sort indicators
	m_vTree->Headers->SortIndicators = headerSortIndicatorsSftTreeAuto;
    m_vTree->Header[0]->SortIndicator = sortIndicatorSftTreeAscending;

    // make a copy of the tree control's font and make a bold
    // font for certain cells

See Also SftTreeItems Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.


Spring Break!

Our offices will be closed this week (March 18 through March 22).

We'll be back March 24 to address any pending sales and support issues.