語言

Stylus.DirectlyOver 屬性

定義

它會接收觸控筆正下方的元件。

public:
 static property System::Windows::IInputElement ^ DirectlyOver { System::Windows::IInputElement ^ get(); };
public static System.Windows.IInputElement DirectlyOver { get; }
static member DirectlyOver : System.Windows.IInputElement
Public Shared ReadOnly Property DirectlyOver As IInputElement

屬性值

IInputElement那個就在觸控筆正下方。

範例

以下範例示範如何判斷唱針所放置的元素。 此範例假設存在被 TextBox 呼叫 textBox1 且 StylusInAirMove 事件與事件處理程序相連。

void Window1_StylusInAirMove(object sender, StylusEventArgs e)
{
    textbox1.AppendText(Stylus.DirectlyOver.ToString() + "\n");
}
Private Sub Window1_StylusInAirMove(ByVal sender As Object, ByVal e As StylusEventArgs) _
    Handles Me.StylusInAirMove

    Dim element As Object
    element = CType(Stylus.DirectlyOver, Object)
    textbox1.AppendText(element.ToString() & vbLf)

End Sub

適用於