UIElement.CaptureStylus UIElement.CaptureStylus UIElement.CaptureStylus UIElement.CaptureStylus Method

定義

嘗試強制將手寫筆的捕捉給這個項目。Attempts to force capture of the stylus to this element.

public:
 virtual bool CaptureStylus();
public bool CaptureStylus ();
abstract member CaptureStylus : unit -> bool
override this.CaptureStylus : unit -> bool
Public Function CaptureStylus () As Boolean

傳回

如果成功捕捉到手寫筆則為 true,否則為 falsetrue if the stylus was successfully captured; otherwise, false.

實作

備註

根據基礎預設手寫筆裝置的預設實值一律true會傳回。The default implementation based on the underlying default stylus device always returns true. 不過, 如果您要擴充為輸入系統提供裝置執行的輸入裝置, 則可以使用替代的手寫筆裝置執行來建立系統, 而這可能會傳回不同的結果。However, if you are extending the input devices that provide the device implementation for the input system, it is possible to create a system with an alternative stylus device implementation that might return different results.

當專案捕捉手寫筆時, 它會接收手寫筆輸入, 即使手寫筆超出其範圍也一樣。When an element captures the stylus, it receives stylus input even if the stylus is outside its bounds. 手寫筆通常只會在拖放作業期間捕捉。The stylus is typically captured only during drag-and-drop operations.

呼叫這個方法會呼叫基礎的Stylus靜態Capture方法。Calling this method calls an underlying static Stylus method Capture. 實際的 capture 行為是由作用中手寫筆裝置執行所執行。The actual capture behavior is implemented by the active stylus device implementation.

若要加以捕獲, 必須啟用元素。To be captured, an element must be enabled. 請先IsEnabled檢查true是否傳回, 再CaptureStylus呼叫。Check whether IsEnabled is true return before you call CaptureStylus.

如果呼叫CaptureStylus true傳回,IsStylusCapturedtrue會是。If calling CaptureStylus returns true, IsStylusCaptured is also true.

適用於