Export (0) Print
Expand All

AccessText.Text Property

Gets or sets the text that is displayed by the AccessText element.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

public string Text { get; set; }
<object>_accessText</object>
- or - 
<object><accessTextObject>_accessText</accessTextObject></object>
<object>
  <string .../>
</object>

XAML Values

_accessText

A string that contains the underscore character. This value becomes an AccessText that handles access keys for the object. The access key is the character that immediately follows the underscore.

accessTextObject

The AccessText.

Property Value

Type: System.String
The text without the first underscore character. The default is an empty string.

Identifier field

TextProperty

Metadata properties set to true

AffectsMeasure, AffectsRender

An access key is not created if you use the Text property to supply text for an AccessText element. This property is used internally to determine the text that is displayed by the access key. You can use this property to set additional text that does not contain the mnemonic (underlined character) or to retrieve the access key text.

The following example creates an access key that customizes the first letter of the access key, which contains the mnemonic, and then sets the rest of the text by using the Text property.

<DockPanel>
<AccessText Background="Red" Foreground="LightBlue" FontFamily="Arial Narrow" FontSize="16" FontStyle="Italic" 
     FontWeight="Bold">_E</AccessText><AccessText Text="dit"/>
</DockPanel>

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft