Label.Target Proprietà

Definizione

Ottiene o imposta l'elemento che riceve lo stato attivo quando l'utente preme il tasto di scelta dell'etichetta.

public:
 property System::Windows::UIElement ^ Target { System::Windows::UIElement ^ get(); void set(System::Windows::UIElement ^ value); };
public System.Windows.UIElement Target { get; set; }
[System.ComponentModel.TypeConverter(typeof(System.Windows.Markup.NameReferenceConverter))]
public System.Windows.UIElement Target { get; set; }
member this.Target : System.Windows.UIElement with get, set
[<System.ComponentModel.TypeConverter(typeof(System.Windows.Markup.NameReferenceConverter))>]
member this.Target : System.Windows.UIElement with get, set
Public Property Target As UIElement

Valore della proprietà

UIElement

Oggetto UIElement che riceve lo stato attivo quando l'utente preme il tasto di scelta. Il valore predefinito è null.

Attributi

Esempio

Nell'esempio seguente viene illustrato come impostare la proprietà Target di un oggetto Label.

<TextBox Name="tb" Width="50"/>
<Label Target="{Binding ElementName=tb}">_File</Label>

Commenti

È possibile fornire tasti di scelta rapida agli elementi che non supportano i tasti di scelta assegnando un Label tasto di scelta e impostando questa proprietà. Assegnare un tasto di scelta a un'etichetta inserendo un carattere di sottolineatura immediatamente prima del carattere che funge da tasto di scelta. È possibile specificare una chiave di scelta nella Content proprietà o impostando Content su un AccessText oggetto .

Non è possibile utilizzare questa proprietà per definire un oggetto UIElement. Ad esempio, il codice seguente viene compilato ma non funzionale: <object.Target><UIElement../></object.Target>. Questa proprietà fornisce un riferimento a un elemento già definito nell'applicazione.

Informazioni proprietà di dipendenza

Campo Identificatore TargetProperty
Proprietà dei metadati impostate su true Nessuno

Uso della sintassi XAML per gli attributi

<Label Target=" nameOfExistingElement"/>  

Utilizzo della sintassi XAML per elementi proprietà

Valori XAML

nameOfExistingElement
Nome di UIElement che riceve lo stato attivo quando viene premuto il tasto di scelta.

Si applica a

Vedi anche