Control.OnPointerEntered(PointerRoutedEventArgs) 方法

定義

PointerEntered 事件發生之前呼叫。

protected:
 virtual void OnPointerEntered(PointerRoutedEventArgs ^ e) = OnPointerEntered;
void OnPointerEntered(PointerRoutedEventArgs const& e);
protected virtual void OnPointerEntered(PointerRoutedEventArgs e);
function onPointerEntered(e)
Protected Overridable Sub OnPointerEntered (e As PointerRoutedEventArgs)

參數

e
PointerRoutedEventArgs

事件的事件資料。

備註

一般而言,如果用戶實際移動指標, 則會引發PointerEnteredPointerExited 事件。 不過,如果使用者未實際移動指標,這些事件也會引發。

  • 如果具有 PointerEntered 處理程式的物件是以程式設計方式在指標下移動,則會引發 PointerEntered 事件,物件 Visibility 會在指標下方從 Collapsed 變更為 Visible ,或游標位於快顯或飛出視窗等元素上方,導致游標現在出現在物件上。
  • 如果 PointerEntered 事件已在對象上引發,當發生 UI 狀態變更時,就會引發對應的 PointerExited 事件,導致指標不再超過該物件。 例如,以程式設計方式將物件位置移至不再位於指標下方、物件 Visibility 設定為 Collapsed,或指標超過暫時性 UI,例如以程式設計方式關閉的彈出視窗或顯示逾時。

適用於

另請參閱