共用方式為


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時,以程式設計方式將焦點提供給主應用程式中的下一個可焦點專案。

適用於