UIElement.KeyboardAcceleratorPlacementTarget Property
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.
public:
property DependencyObject ^ KeyboardAcceleratorPlacementTarget { DependencyObject ^ get(); void set(DependencyObject ^ value); };
DependencyObject KeyboardAcceleratorPlacementTarget();
void KeyboardAcceleratorPlacementTarget(DependencyObject value);
public DependencyObject KeyboardAcceleratorPlacementTarget { get; set; }
var dependencyObject = uIElement.keyboardAcceleratorPlacementTarget;
uIElement.keyboardAcceleratorPlacementTarget = dependencyObject;
Public Property KeyboardAcceleratorPlacementTarget As DependencyObject
The control tooltip that displays the accelerator key combination.
Device family |
Windows 10, version 1803 (introduced in 10.0.17134.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v6.0)
|
<Grid x:Name="Container">
<Button Content="Click"
ToolTipService.ToolTip="Tooltip"
ToolTipService.PlacementTarget="{x:Bind Container}"
KeyboardAcceleratorPlacementTarget="{x:Bind Container}">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Key="S" Modifiers="Control"/>
</Button.KeyboardAccelerators>
</Button>
</Grid>
In some cases, you might need to present a tooltip relative to another element (typically a container object). For example, a Pivot control that displays the tooltip for a PivotItem with the Pivot header.
Here, we show how to use the KeyboardAcceleratorPlacementTarget property to display the keyboard accelerator key combination for a Save button with the Grid container instead of the button.
<Grid x:Name="Container">
<Button Content="Save" Click="OnSave">
<Button.KeyboardAccelerators>
<KeyboardAccelerator Key="S" Modifiers="Control"
KeyboardAcceleratorPlacementTarget="{x:Bind Container}"/>
</Button.KeyboardAccelerators>
</Button>
</Grid>
Use the KeyboardAcceleratorPlacementMode property to specify whether the control tooltip displays the key combination for its associated keyboard accelerator.
Product | Versions |
---|---|
WinRT | Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |