共用方式為


DesktopWindowXamlSource.TakeFocusRequested 事件

定義

例如,當主機桌面應用程式收到來自 DesktopWindowXamlSource 物件的要求取回焦點 (時發生,例如,使用者位於 DesktopWindowXamlSource 中的最後一個可設定焦點元素,然後按 Tab) 。

// Register
event_token TakeFocusRequested(TypedEventHandler<DesktopWindowXamlSource, DesktopWindowXamlSourceTakeFocusRequestedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
DesktopWindowXamlSource::TakeFocusRequested_revoker TakeFocusRequested(auto_revoke_t, TypedEventHandler<DesktopWindowXamlSource, DesktopWindowXamlSourceTakeFocusRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<DesktopWindowXamlSource,DesktopWindowXamlSourceTakeFocusRequestedEventArgs> TakeFocusRequested;
function onTakeFocusRequested(eventArgs) { /* Your code */ }
desktopWindowXamlSource.addEventListener("takefocusrequested", onTakeFocusRequested);
desktopWindowXamlSource.removeEventListener("takefocusrequested", onTakeFocusRequested);
- or -
desktopWindowXamlSource.ontakefocusrequested = onTakeFocusRequested;
Public Custom Event TakeFocusRequested As TypedEventHandler(Of DesktopWindowXamlSource, DesktopWindowXamlSourceTakeFocusRequestedEventArgs) 

事件類型

備註

當您將 DesktopWindowXamlSource 新增至傳統型應用程式時, DesktopWindowXamlSource 預設不會透過 Tab 鍵或方向鍵等鍵盤事件自動處理焦點流覽。 當使用者離開 DesktopWindowXamlSource時,請處理此事件,以程式設計方式將焦點提供給主應用程式中的下一個可焦點專案。

適用於