Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

PlusMinusImageExpandable Property, SftTreeItems Object

Defines the graphic used to display an expandable item's plus/minus graphic.

Syntax

Get

VB.NETrefImageObj = object.PlusMinusImageExpandable As SftPictureObject
VBSet refImageObj = object.PlusMinusImageExpandable As SftPictureObject
C#.NETSftPictureObject refImageObj = object.PlusMinusImageExpandable;
VC++ISftPictureObject* refImageObj = object->PlusMinusImageExpandable;
ISftPictureObject* refImageObj = object->GetPlusMinusImageExpandable();
CHRESULT object->get_PlusMinusImageExpandable(ISftPictureObject** refImageObj);

Put

VB.NETobject.PlusMinusImageExpandable = refImageObj As SftPictureObject
VBobject.PlusMinusImageExpandable = refImageObj As SftPictureObject
C#.NETSftPictureObject object.PlusMinusImageExpandable = refImageObj;
VC++ISftPictureObject* object->PlusMinusImageExpandable = refImageObj;
void object->PutPlusMinusImageExpandable(ISftPictureObject* refImageObj);
CHRESULT object->put_PlusMinusImageExpandable(ISftPictureObject* refImageObj);

object

A SftTreeItems object.

refImageObj

Defines the graphic used to display an expandable item's plus/minus graphic. Only bitmaps are supported (GDI+ images, icons, metafiles, ImageLists, etc. are not supported).

Comments

The PlusMinusImageExpandable property defines the graphic used to display an expandable item's plus/minus graphic.

All items which are expandable will be displayed with this plus/minus graphic. Individual items cannot override the plus/minus graphic.

Plus/minus graphics are not shown until the properties PlusMinusImageExpandable and Items.PlusMinusImageExpanded define valid graphics. The Items.PlusMinusImageLeaf property is optional.

All graphics used in a tree control as PlusMinusImageExpandable, Items.PlusMinusImageExpanded and Items.PlusMinusImageLeaf 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 plus/minus graphics are never clipped vertically. To change the plus/minus graphic size, the plus/minus graphics properties PlusMinusImageExpandable, Items.PlusMinusImageExpanded and Items.PlusMinusImageLeaf must be set to the value Nothing (NULL) before assigning new plus/minus graphics.

If an item is disabled (see Item.Enabled property), the plus/minus 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 PlusMinusImageExpandable property can be set to the value Nothing (NULL). Plus/minus graphics are then no longer displayed.

Examples

VB.NET

        ' Make columns optimal
        AxSftTree1.ColumnsObj.MakeOptimal()
        ' allow horizontal scrolling
        AxSftTree1.Items.RecalcHorizontalExtent()
    End Sub

    Private Sub PlusMinusCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PlusMinusCheckBox.CheckedChanged
        If PlusMinusCheckBox.Checked Then
            AxSftTree1.Items.PlusMinusImageExpandable.NETImageObject = PlusMinusImageList.Images(0)
            AxSftTree1.Items.PlusMinusImageExpanded.NETImageObject = PlusMinusImageList.Images(1)
        Else
            AxSftTree1.Items.PlusMinusImageExpandable.Clear()
            AxSftTree1.Items.PlusMinusImageExpanded.Clear()
        End If
    End Sub

VB6

        .ColumnsObj.MakeOptimal
        ' allow horizontal scrolling
        .Items.RecalcHorizontalExtent
    End With
End Sub

Private Sub ShowPlusMin_Click()
    If ShowPlusMin.Value = 0 Then
        SftTree1.Items.PlusMinusImageExpandable.Clear
        SftTree1.Items.PlusMinusImageExpanded.Clear
    Else
        Set SftTree1.Items.PlusMinusImageExpandable.Picture = Plus.Picture
        Set SftTree1.Items.PlusMinusImageExpanded.Picture = Minus.Picture
    End If
End Sub

C#

            // Make columns optimal
            axSftTree1.ColumnsObj.MakeOptimal();
            // allow horizontal scrolling
            axSftTree1.Items.RecalcHorizontalExtent();
        }

        private void plusMinusCheckBox_CheckedChanged(object sender, System.EventArgs e) {
            if (plusMinusCheckBox.Checked) {
                axSftTree1.Items.PlusMinusImageExpandable.NETImageObject = plusMinusImageList.Images[0];
                axSftTree1.Items.PlusMinusImageExpanded.NETImageObject = plusMinusImageList.Images[1];
            } else {
                axSftTree1.Items.PlusMinusImageExpandable.Clear();
                axSftTree1.Items.PlusMinusImageExpanded.Clear();
            }
        }

C++

void CBookTableDlg::OnCancel()
{
    CDialog::OnCancel();
}

void CBookTableDlg::OnCheckShowPlusMinClicked()
{
    if (m_CheckPlusMin.GetCheck()) {
        m_vTree->Items->PlusMinusImageExpandable->PutBitmapHandle((OLE_HANDLE)(HBITMAP)m_Plus);
        m_vTree->Items->PlusMinusImageExpanded->PutBitmapHandle((OLE_HANDLE)(HBITMAP)m_Minus);
    } else {
        m_vTree->Items->PlusMinusImageExpandable->Clear();
        m_vTree->Items->PlusMinusImageExpanded->Clear();
    }
}

See Also SftTreeItems Object | Object Hierarchy


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