Compartilhar via


CSliderCtrl::SetBuddy

Assigns a window as the buddy window for a slider control.

CWnd* SetBuddy(
   CWnd* pWndBuddy,
   BOOL fLocation = TRUE 
);

Parameters

  • pWndBuddy
    A pointer to a CWnd object that will be set as the slider control's buddy.

  • fLocation
    Value specifying the location at which to display the buddy window. This value can be one of the following:

    • TRUE   The buddy will appear to the left of the trackbar if the trackbar control uses the TBS_HORZ style. If the trackbar uses the TBS_VERT style, the buddy appears above the trackbar control.

    • FALSE   The buddy will appear to the right of the trackbar if the trackbar control uses the TBS_HORZ style. If the trackbar uses the TBS_VERT style, the buddy appears below the trackbar control.

Return Value

A pointer to a CWnd object that was previously assigned to the slider control at that location.

Remarks

This member function implements the behavior of the Win32 message TBM_SETBUDDY, as described in the Windows SDK. Note that this member function uses pointers to CWnd objects, rather than window handles for both its return value and parameter.

For a description of the slider control styles, see Trackbar Control Styles in the Windows SDK.

Requirements

Header: afxcmn.h

See Also

Reference

CSliderCtrl Class

Hierarchy Chart

CSliderCtrl::GetBuddy

Other Resources

CSliderCtrl Members