HeaderPane
Main
Hide
Share Link
Print

Type Property, SftPictureObject Object

Returns the defined image type.

Syntax

Get

C#SftPictureTypeConstants Style = object.Type;
VB.NETStyle = object.Type As SftPictureTypeConstants
C++enum SftPictureTypeConstants Style = object->Type;
enum SftPictureTypeConstants Style = object->GetType();
CHRESULT object->get_Type(enum SftPictureTypeConstants* Style);
VBStyle = object.Type As SftPictureTypeConstants

object

A SftPictureObject object.

Style

Returns the defined image type.

NameValueDescription
sftTypeNone0None - The SftPictureObject is empty.
sftTypeIDispatch1IDispatch - Contains an OLE Picture object (supporting the IPicture or IPictureDisp interface).
sftTypeBitmap2Bitmap - Contains a Windows bitmap.
sftTypeIcon3Icon - Contains an icon.
sftTypeImageList4ImageList - Contains an image from an ImageList control.
sftTypeColorSample5Color Sample - Contains a color sample.
sftTypeBuiltin6Built-In Appearance - Contains a predefined built-in image.
sftTypeImageListH7ImageListH - Contains an image from an ImageList control.
sftTypeGDIPlus8GDIPlus - Contains a GDI+ image
sftTypeNET9.NET - Contains a .NET image object.

Comments

The Type property returns the defined image type.

The Type property reflects the type of the current image. It is modified by assigning an image to the SftPictureObject using a property such as SftPictureObject.Appearance, SftPictureObject.BitmapHandle, SftPictureObject.IconHandle, SftPictureObject.SetColorSample, etc.

Examples

C# View entire sample code

            int curr = axSftTree1.Items.Current;
            // cell text
            System.Windows.Forms.DataObject data = new System.Windows.Forms.DataObject();
            data.SetData(DataFormats.Text, axSftTree1.get_Cell(curr, 0).Text);

            // item picture
            SftPictureObject img = null;
            if (axSftTree1.get_Item(curr).Image.Type == SftPictureTypeConstants.sftTypeIDispatch) {
                img = axSftTree1.get_Item(curr).Image;
            } else {
                if (axSftTree1.get_Item(curr).Expanded)
                    img = axSftTree1.Items.ItemImageExpanded;
                else if (axSftTree1.get_Item(curr).DependentAllCount > 0)
                    img = axSftTree1.Items.ItemImageExpandable;
                else
                    img = axSftTree1.Items.ItemImageLeaf;

VB.NET View entire sample code

        ' cell text
        Dim Data As System.Windows.Forms.DataObject
        Data = New System.Windows.Forms.DataObject()
        Data.SetData(DataFormats.Text, AxSftTree1.get_Cell(curr, 0).Text)

        ' item picture
        Dim img As SftPictureObject
        If AxSftTree1.get_Item(curr).Image.Type = SftPictureTypeConstants.sftTypeIDispatch Then
            img = AxSftTree1.get_Item(curr).Image
        Else
            If AxSftTree1.get_Item(curr).Expanded Then
                img = AxSftTree1.Items.ItemImageExpanded
            ElseIf AxSftTree1.get_Item(curr).DependentAllCount > 0 Then
                img = AxSftTree1.Items.ItemImageExpandable
            Else
                img = AxSftTree1.Items.ItemImageLeaf

C++ View entire sample code

{
    IVDMDataObjectPtr pDataObject = *Data;
    ASSERT(pDataObject != NULL);

    long curr = m_vTree->Items->Current;
    // cell text
    pDataObject->SetData(_variant_t(m_vTree->Cell[curr][0]->Text), _variant_t((short)sftCFText));
    // item picture
    if (m_vTree->Item[curr]->Image->Type == sftTypeIDispatch) {
        pDataObject->SetData(_variant_t(m_vTree->Item[curr]->Image->GetPicture(), _variant_t((short)sftCFDIB)));
    } else {
        if (m_vTree->Item[curr]->Expanded != VARIANT_FALSE)
            pDataObject->SetData(_variant_t(m_vTree->Items->ItemImageExpanded->GetPicture(), _variant_t((short)sftCFDIB)));
        else if (m_vTree->Item[curr]->DependentAllCount > 0)
            pDataObject->SetData(_variant_t(m_vTree->Items->ItemImageExpandable->GetPicture(), _variant_t((short)sftCFDIB)));
        else

VB6 View entire sample code

Private Sub SftTree1_OLEStartDrag(Data As SftTreeLib80.DataObject, AllowedEffects As Long)
    Dim curr As Integer
    curr = SftTree1.Items.Current
    ' cell text
    Data.SetData SftTree1.Cell(curr, 0).Text, vbCFText
    ' item picture
    If SftTree1.Item(curr).Image.Type = sftTypeIDispatch Then
        Data.SetData SftTree1.Item(curr).Image.Picture, vbCFDIB
    Else
        If SftTree1.Item(curr).Expanded Then
            Data.SetData SftTree1.Items.ItemImageExpanded.Picture, vbCFDIB
        ElseIf SftTree1.Item(curr).DependentAllCount > 0 Then
            Data.SetData SftTree1.Items.ItemImageExpandable.Picture, vbCFDIB
        Else
            Data.SetData SftTree1.Items.ItemImageLeaf.Picture, vbCFDIB
        End If

See Also SftPictureObject Object | Object Hierarchy


Last Updated 11/03/2026 - (email)
© 2026 Softel vdm, Inc.