다음을 통해 공유


ToolTipService.SetPlacementTarget(DependencyObject, UIElement) 메서드

정의

개체의 PlacementTarget 연결된 속성 값을 설정합니다.

public:
 static void SetPlacementTarget(System::Windows::DependencyObject ^ element, System::Windows::UIElement ^ value);
public static void SetPlacementTarget (System.Windows.DependencyObject element, System.Windows.UIElement value);
static member SetPlacementTarget : System.Windows.DependencyObject * System.Windows.UIElement -> unit
Public Shared Sub SetPlacementTarget (element As DependencyObject, value As UIElement)

매개 변수

element
DependencyObject

연결된 속성이 작성될 개체입니다.

value
UIElement

설정할 값입니다.

예제

다음 예제에서는 연결된 속성의 값을 ToolTipService.PlacementTarget 설정하는 방법을 보여 있습니다.

   //create the button that displays the tooltip
   Button targetButton = new Button();
   targetButton.Content = "tooltip Placement Target";

   //create a button that owns the tooltip
   Button tooltipOwner = new Button();
   tooltipOwner.Content = "tooltip owner";
   tooltipOwner.ToolTip = "The ToolTip";
   ToolTipService.SetPlacement(tooltipOwner,PlacementMode.Top);
   ToolTipService.SetPlacementTarget(tooltipOwner,targetButton);
'create the button that displays the tooltip
Dim targetButton As New Button()
targetButton.Content = "tooltip Placement Target"

'create a button that owns the tooltip
Dim tooltipOwner As New Button()
tooltipOwner.Content = "tooltip owner"
tooltipOwner.ToolTip = "The ToolTip"
ToolTipService.SetPlacement(tooltipOwner,PlacementMode.Top)
ToolTipService.SetPlacementTarget(tooltipOwner,targetButton)

적용 대상

추가 정보