Condividi tramite


InputFocusController.GotFocus Evento

Definizione

Si verifica quando l'oggetto ContentIsland associato riceve lo stato attivo.

// Register
event_token GotFocus(TypedEventHandler<InputFocusController, FocusChangedEventArgs const&> const& handler) const;

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

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

Tipo evento

Commenti

ContentIsland può ricevere lo stato attivo tramite il metodo TrySetFocus o perché lo stato attivo viene spostato da un'altra posizione. Ad esempio, un'app che usa desktopChildSiteBridge per ospitare il contenuto deve segnalare che lo stato attivo consiste nel passare al contenuto chiamando SetFocus sul HWND del bridge. Il bridge verrà quindi spostato internamente sull'HWND sottostante di ContentIsland e verrà generato l'evento GotFocus .

Nota

Se l'HWND di primo livello di un'app ha lo stato attivo e diventa inattivo, lo stato attivo andrà perso e non verrà riattivato una volta che HWND è nuovamente attivo. Lo stato attivo verrà invece impostato sulla finestra di primo livello attivata e HWND non genererà l'evento GotFocus , ad esempio se l'utente ALT+TAB torna all'app.

In questo caso, è necessario impostare manualmente lo stato attivo su ContentIsland. InputActivationListener supporta gli eventi che consentono di determinare quando è stata attivata una finestra.

Si applica a

Vedi anche