Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

HorizontalExtent

Defines the horizontal extent (in pixels) of the displayable area.

C

int WINAPI SftTree_GetHorizontalExtent(HWND hwndCtl);
BOOL WINAPI SftTree_SetHorizontalExtent(HWND hwndCtl, int width);
int WINAPI SftTreeSplit_GetHorizontalExtent(HWND hwndCtl, BOOL fLeft);
BOOL WINAPI SftTreeSplit_SetHorizontalExtent(HWND hwndCtl, int width, BOOL fLeft);

C++

int CSftTree::GetHorizontalExtent() const;
BOOL CSftTree::SetHorizontalExtent(int width);
int CSftTreeSplit::GetHorizontalExtent(BOOL fLeft = FALSE) const;
BOOL CSftTreeSplit::SetHorizontalExtent(int width, BOOL fLeft = FALSE);

Parameters

hwndCtl

The window handle of the tree control.

width

The new width (in pixels) of the displayable area. If this parameter is greater than the window width, the tree control can be scrolled horizontally.

fLeft

Set to TRUE to return or set the horizontal extent of the left side of a split tree control (the portion of the tree control containing the hierarchy). If FALSE is specified, the horizontal extent of the right side is returned or set.

Returns

GetHorizontalExtent returns the width of the tree control's displayable area in pixels.

SetHorizontalExtent returns TRUE if the function was successful, otherwise FALSE is returned.

Comments

The GetHorizontalExtent and SetHorizontalExtents functions define the horizontal extent (in pixels) of the displayable area.

A tree control's displayable area can be wider than the tree control's window width. If the displayable area is wider, the tree control can be scrolled horizontally if it has a horizontal scroll bar (WS_HSCROLL window style). The width of the displayable area can be set by the application using SetHorizontalExtent or by calculating the optimal width using RecalcHorizontalExtent. For performance reasons, the optimal width is not automatically calculated when adding items to a tree control.

The width set using SetHorizontalExtent must be equal to or greater than the combined column widths, otherwise it will fail.

If the width returned is smaller than the actual window width, the control cannot be scrolled horizontally. The horizontal scroll bar will be disabled or hidden, based on the window style SFTTREESTYLE_DISABLENOSCROLL.

See Also C/C++ API | Categories | Notifications