ToolTipService.SetPlacementTarget(DependencyObject, UIElement) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the value of the PlacementTarget attached property for an object.
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)
Parameters
- element
- DependencyObject
The object to which the attached property is written.
- value
- UIElement
The value to set.
Examples
The following example shows how to set the value for the ToolTipService.PlacementTarget
attached property.
//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)
Applies to
See also
Bekerjasama dengan kami di GitHub
Sumber untuk kandungan ini boleh didapati di GitHub, di mana anda juga boleh mencipta dan menyemak isu dan menarik permintaan. Untuk maklumat lanjut, lihat panduan penyumbang kami.