共用方式為


CoreInputView.TryTransferXYFocusToPrimaryView 方法

定義

嘗試將焦點從應用程式 UI 移至輸入窗格。

public:
 virtual bool TryTransferXYFocusToPrimaryView(Rect origin, CoreInputViewXYFocusTransferDirection direction) = TryTransferXYFocusToPrimaryView;
bool TryTransferXYFocusToPrimaryView(Rect const& origin, CoreInputViewXYFocusTransferDirection const& direction);
public bool TryTransferXYFocusToPrimaryView(Rect origin, CoreInputViewXYFocusTransferDirection direction);
function tryTransferXYFocusToPrimaryView(origin, direction)
Public Function TryTransferXYFocusToPrimaryView (origin As Rect, direction As CoreInputViewXYFocusTransferDirection) As Boolean

參數

origin
Rect

矩形,在用戶端座標中,代表先前焦點的 UI 元素。 在與裝置無關的圖元中指定, (DIP) 。

direction
CoreInputViewXYFocusTransferDirection

導覽的方向。 如果輸入窗格未位於指定的方向,則此方法會失敗並傳回 false。

傳回

Boolean

bool

如果輸入窗格收到焦點,則為 True。 否則為 false。

Windows 需求

裝置系列
Windows 10, version 1803 (已於 10.0.17134.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v6.0 引進)

備註

主要檢視是指 CoreInputViewKind.KeyboardCoreInputViewKind.Handwriting 檢視,而 CoreInputView 可以是 CoreInputViewKind的任何值。

適用於

另請參閱