共用方式為


StylusDevice.InAir 屬性

定義

取得值,這個值表示 Tablet 畫筆是否位於數位板上方但未與其接觸。

public:
 property bool InAir { bool get(); };
public bool InAir { get; }
member this.InAir : bool
Public ReadOnly Property InAir As Boolean

屬性值

如果畫筆位於數位板上方但未與其接觸,則為 true,否則為false。 預設為 false

範例

下列範例示範 InAir 屬性。

private void OnMouseMove(object sender, MouseEventArgs e)
{
    StylusDevice myStylusDevice = e.StylusDevice;

    if (myStylusDevice != null)
    {
        if (myStylusDevice.InAir)
        {
            textbox1.Text = "stylus moves in air";
        }
        else
        {
            textbox1.Text = "stylus moves with pen down";
        }
    }
}
Private Sub OnMouseMove(ByVal sender As Object, _
                        ByVal e As MouseEventArgs)

    Dim myStylusDevice As StylusDevice
    myStylusDevice = e.StylusDevice
    If Not IsNothing(myStylusDevice) Then
        If myStylusDevice.InAir = True Then
            textbox1.Text = "stylus moves in air"
        Else
            textbox1.Text = "stylus moves with pen down"
        End If
    End If
End Sub

適用於