ToolTip.Placement Property

Definition

Gets or sets how a ToolTip is positioned in relation to the placement target element.

C#
public PlacementMode Placement { get; set; }
XAML
<ToolTip Placement="placementModeMemberName"/>

Property Value

One of the PlacementMode values.

Examples

The following code example demonstrates the placement modes for a ToolTip.

XAML
<StackPanel Margin="120" >
    <TextBlock Text="ToolTip Control"/>
    <TextBlock Text="Hover over an item to see its ToolTip: " Margin="0,10"/>
    <ListBox Width="100" HorizontalAlignment="Left">
        <ListBoxItem Content="Left" 
            ToolTipService.ToolTip="ToolTip to the left." 
            ToolTipService.Placement="Left" />
        <ListBoxItem Content="Right" 
            ToolTipService.ToolTip="ToolTip to the right." 
            ToolTipService.Placement="Right" />
        <ListBoxItem Content="Top" 
            ToolTipService.ToolTip="ToolTip at the top." 
            ToolTipService.Placement="Top" />
        <ListBoxItem Content="Bottom" 
            ToolTipService.ToolTip="ToolTip at the bottom." 
            ToolTipService.Placement="Bottom"/>
        <ListBoxItem Content="Mouse" 
            ToolTipService.ToolTip="ToolTip based on the cursor position." 
            ToolTipService.Placement="Mouse"/>
    </ListBox>
</StackPanel>

Remarks

If there is no explicit PlacementTarget, the placement target for a ToolTip is the element that specifies the ToolTip as the value for its TooltipService.ToolTip attached property value, and any Placement value applies to that target.

Placement and PlacementTarget are usually left as the defaults. The scenario for specifying either or both of these properties is if you are trying to avoid a case where the tooltip obscures the content it is referring to while the tooltip is displayed.

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

See also