Share via

ToolTipService.SetPlacementTarget(DependencyObject, UIElement) Method


Sets the ToolTipService.PlacementTarget XAML attached property value for the specified target element.

 static void SetPlacementTarget(DependencyObject ^ element, UIElement ^ value);
 static void SetPlacementTarget(DependencyObject const& element, UIElement const& value);
public static void SetPlacementTarget(DependencyObject element, UIElement value);
function setPlacementTarget(element, value)
Public Shared Sub SetPlacementTarget (element As DependencyObject, value As UIElement)



The target element for the attached property value.


The visual element that should be the placement target for the tooltip.


This method supports the ToolTipService.PlacementTarget attached property usage for Extensible Application Markup Language (XAML). The value for element is not necessarily a ToolTip, it might be an element that owns an inferred tooltip through usage of ToolTipService APIs. You can use the ToolTipService.PlacementTarget attached property to set the placement target to be different than the element that owns the ToolTip for purposes of UI behavior and built-in PointerEntered / PointerExited handling. This enables controls to act like a unit for tooltip display, so that the tooltip from one control does not obscure an important part of a related control when it displays.

Applies to

See also