Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

ButtonPicture Property, SftTree Object

Defines the graphic used to display expand/collapse buttons.

Deprecated - Provided for compatibility with earlier versions only - Use the ButtonAppearance property instead

Syntax

Get

VB.NETrefPictureObj = object.ButtonPicture As System.Drawing.Image
VBSet refPictureObj = object.ButtonPicture As IPictureDisp
C#.NETSystem.Drawing.Image refPictureObj = object.ButtonPicture;
VC++IPictureDisp* refPictureObj = object->GetButtonPicture();
CHRESULT object->get_ButtonPicture(IPictureDisp** refPictureObj);

Put

VB.NETobject.let_ButtonPicture(ByVal refPictureObj As System.Drawing.Image)
VBobject.ButtonPicture = refPictureObj As IPictureDisp
C#.NETvoid object.let_ButtonPicture(System.Drawing.Image refPictureObj);
VC++void object->PutButtonPicture(IPictureDisp* refPictureObj);
CHRESULT object->put_ButtonPicture(IPictureDisp* refPictureObj);

PutRef

VB.NETobject.ButtonPicture = refPictureObj As System.Drawing.Image
VBSet object.ButtonPicture = refPictureObj As IPictureDisp
C#.NETSystem.Drawing.Image object.ButtonPicture = refPictureObj;
VC++void object->PutRefButtonPicture(IPictureDisp* refPictureObj);
CHRESULT object->putref_ButtonPicture(IPictureDisp* refPictureObj);

object

A SftTree object.

refPictureObj

A Picture object. This Picture object contains the graphic used to display the expand/collapse buttons. The refPictureObj object must represent a bitmap and cannot represent an icon or a metafile. For information about picture properties, please visit the applicable section "Using SftTree/OCX with ...".

Comments

Deprecated - Provided for compatibility with earlier versions only - Use the ButtonAppearance property instead

The ButtonPicture property defines the graphic used to display expand/collapse buttons.

The ButtonPicture and ButtonPictureH properties are synonyms, but accept different value types (Picture object reference or Windows bitmap handle).

The ButtonPicture property can be used to override the default expand/collapse buttons provided by a tree control. The refPictureObj object must represent a bitmap and cannot represent an icon or a metafile.

The bitmap represented by the refPictureObj object must contain four equal-sized images of an expand/collapse button in the following 4 states:

  • up, expandable item. The default is a 12 x 11 button with a '+' image.
  • up, expanded item. The default is a 12 x 11 button with a '-' image.
  • down, expandable item. The default is a 12 x 11 button with a '+' image.
  • down, expanded item. The default is a 12 x 11 button with a '-' image.

The buttons are arranged horizontally in the bitmap, so the height of the bitmap is the height of one button and the width of the bitmap is four times the width of one button. The top, left pixel of each button bitmap must contain the background color. This color will be replaced by the actual item background color when the bitmap is displayed.

All items use the same expand/collapse button graphic. Expand/collapse buttons are only shown if the ButtonStyle property is set accordingly. Only parent items with dependents receive an expand/collapse button. Leaf items never have an expand/collapse button.

The ButtonPicture property can be set to the value Nothing (NULL), which restores the tree control's default, built-in expand/collapse button bitmap.

The ButtonStyle property can be used to define the presence of expand/collapse buttons.

The height of the items displayed is adjusted if necessary so the complete button graphic can be displayed vertically and horizontally.

Sample button bitmaps can be found in the directory \Program Files\Softelvdm\SftTree OCX 7.5\Images. E.g., Buttons4.bmp contains the button image as used by Windows Explorer.

Using PutRef (see Syntax above) the control will use the reference to the Picture object. If the Picture object is later changed, this will also affect the image used by the control. Using Put instead causes the control to create a copy of the Picture object. If the Picture object is later changed, this will not affect the image used by the control as it uses a copy of the object. Because of the additional overhead and the increased resource use of Put, PutRef is the preferred method.

Examples

VB.NET

        Else
            AxSftTree1.Items.PlusMinusImageExpandable.Clear()
            AxSftTree1.Items.PlusMinusImageExpanded.Clear()
        End If
    End Sub

    Private Sub UglyCheckBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UglyCheckBox.CheckedChanged
        If UglyCheckBox.Checked Then
            AxSftTree1.ButtonPicture = ButtonImageList.Images(0)
        Else
            AxSftTree1.ButtonPicture = Nothing
        End If
    End Sub

    Private Sub SortHeader(ByVal ColNum As Integer)
        Dim SortedColumn As Integer

VB6

    Else
        Set SftTree1.Items.PlusMinusImageExpandable.Picture = Plus.Picture
        Set SftTree1.Items.PlusMinusImageExpanded.Picture = Minus.Picture
    End If
End Sub

Private Sub Ugly_Click()
    If Ugly.Value = 0 Then
        SftTree1.ButtonPicture = Nothing
    Else
        Set SftTree1.ButtonPicture = UglyButtons.Picture
    End If
End Sub

Private Sub SortHeader()
    With SftTree1

C#

            } else {
                axSftTree1.Items.PlusMinusImageExpandable.Clear();
                axSftTree1.Items.PlusMinusImageExpanded.Clear();
            }
        }

        private void uglyCheckBox_CheckedChanged(object sender, System.EventArgs e) {
            if (uglyCheckBox.Checked)
                axSftTree1.ButtonPicture = buttonImageList.Images[0];
            else
                axSftTree1.ButtonPicture = null;
        }

        private void SortHeader(short ColNum) {
            // get the new, sorted column
            short sortedColumn = axSftTree1.Headers.SortedColumn;

See Also SftTree Object | Object Hierarchy


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