Share via


DesktopWindowXamlSource.GotFocus Evento

Definizione

Si verifica quando DesktopWindowXamlSource ottiene lo stato attivo nell'applicazione desktop( ad esempio, l'utente preme il tasto Tab mentre lo stato attivo si trova sull'elemento appena prima di DesktopWindowXamlSource).

// Register
event_token GotFocus(TypedEventHandler<DesktopWindowXamlSource, DesktopWindowXamlSourceGotFocusEventArgs const&> const& handler) const;

// Revoke with event_token
void GotFocus(event_token const* cookie) const;

// Revoke with event_revoker
DesktopWindowXamlSource::GotFocus_revoker GotFocus(auto_revoke_t, TypedEventHandler<DesktopWindowXamlSource, DesktopWindowXamlSourceGotFocusEventArgs const&> const& handler) const;
public event TypedEventHandler<DesktopWindowXamlSource,DesktopWindowXamlSourceGotFocusEventArgs> GotFocus;
function onGotFocus(eventArgs) { /* Your code */ }
desktopWindowXamlSource.addEventListener("gotfocus", onGotFocus);
desktopWindowXamlSource.removeEventListener("gotfocus", onGotFocus);
- or -
desktopWindowXamlSource.ongotfocus = onGotFocus;
Public Custom Event GotFocus As TypedEventHandler(Of DesktopWindowXamlSource, DesktopWindowXamlSourceGotFocusEventArgs) 

Tipo evento

Commenti

Quando si aggiunge un oggetto DesktopWindowXamlSource all'applicazione desktop, per impostazione predefinita DesktopWindowXamlSource non gestisce automaticamente lo spostamento dello stato attivo tramite eventi della tastiera, ad esempio tabulazione o tasti di direzione. Chiamare il metodo NavigateFocus per assegnare lo stato attivo a livello di codice quando l'utente passa a DesktopWindowXamlSource.

Gestire l'evento GotFocus per ricevere una notifica quando l'utente immette DesktopWindowXamlSource tramite un evento non da tastiera, ad esempio un clic del mouse e si vuole mantenere aggiornato lo stato dell'interfaccia utente nell'applicazione desktop host.

Si applica a