UIElement.KeyTipTarget Property
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.
Gets or sets a value that indicates the element targeted by the access key keytip.
public:
property DependencyObject ^ KeyTipTarget { DependencyObject ^ get(); void set(DependencyObject ^ value); };
DependencyObject KeyTipTarget();
void KeyTipTarget(DependencyObject value);
public DependencyObject KeyTipTarget { get; set; }
var dependencyObject = uIElement.keyTipTarget;
uIElement.keyTipTarget = dependencyObject;
Public Property KeyTipTarget As DependencyObject
Property Value
The element targeted by the keytip.
Windows requirements
| Device family |
Windows 10, version 1803 (introduced in 10.0.17134.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced in v6.0)
|
Examples
In this example, we specify the access key for a Grid element, but we target the text heading of the Grid.
<StackPanel>
<TextBlock x:Name="Heading1">Heading 1</TextBlock>
<Grid
AccessKey="1"
AccessKeyInvoked="Invoke1"
KeyTipTarget="{x:Bind Heading1}">
<!-- ... -->
</Grid>
<TextBlock x:Name="Heading2">Heading 2</TextBlock>
<Grid
AccessKey="2"
AccessKeyInvoked="Invoke2"
KeyTipTarget="{x:Bind Heading2}">
<!-- ... -->
</Grid>
</StackPanel>
Remarks
Keytips are badges displayed next to controls that support access keys when the user presses the Alt key. Each keytip contains the alphanumeric keys that activate the associated control.
The KeyTipPlacementMode property is used to specify the ___location of the access key keytip relative to the boundary of the targeted element.