Hide

SftTree/OCX 7.5 - ActiveX Tree Control

Display
Print

ButtonPictureH 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.NETHandle = object.ButtonPictureH As Integer
VBHandle = object.ButtonPictureH As OLE_HANDLE
C#.NETint Handle = object.ButtonPictureH;
VC++OLE_HANDLE Handle = object->ButtonPictureH;
OLE_HANDLE Handle = object->GetButtonPictureH();
CHRESULT object->get_ButtonPictureH(OLE_HANDLE* Handle);

Put

VB.NETobject.ButtonPictureH = Handle As Integer
VBobject.ButtonPictureH = Handle As OLE_HANDLE
C#.NETint object.ButtonPictureH = Handle;
VC++OLE_HANDLE object->ButtonPictureH = Handle;
void object->PutButtonPictureH(OLE_HANDLE Handle);
CHRESULT object->put_ButtonPictureH(OLE_HANDLE Handle);

object

A SftTree object.

Handle

A bitmap handle. This bitmap contains the graphic used to display the expand/collapse buttons. This bitmap handle has to remain valid until the tree control no longer uses it. The application has to destroy the bitmap handle once it is no longer needed.

Comments

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

The ButtonPictureH 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 ButtonPictureH property can be used to override the default expand/collapse buttons provided by a tree control.

The bitmap represented by Handle 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 ButtonPictureH property can be set to 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.

Examples

C++

        m_vTree->Items->PlusMinusImageExpandable->Clear();
        m_vTree->Items->PlusMinusImageExpanded->Clear();
    }
}

void CBookTableDlg::OnCheckUsePlainClicked()
{
    if (m_CheckUsePlain.GetCheck())
        m_vTree->PutButtonPictureH((OLE_HANDLE)(HBITMAP)m_Plain);
    else
        m_vTree->PutButtonPictureH(NULL);
}

void CBookTableDlg::SortHeader(short colIndex)
{
	// get the new, sorted column

See Also SftTree Object | Object Hierarchy


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