Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

Type Property, SftPictureObject Object

Returns the defined image type.

Syntax

Get

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

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

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

VB.NET

        ' 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

VB6

Private Sub SftTree1_OLEStartDrag(Data As SftTreeLib75.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

C#

            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;

C++

{
    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

See Also SftPictureObject Object | Object Hierarchy


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