StylusDevice.InAir Property

 

Gets whether the tablet pen is positioned above, yet not in contact with, the digitizer.

Namespace:   System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

public bool InAir { get; }

Property Value

Type: System.Boolean

true if the pen is positioned above, yet not in contact with, the digitizer; otherwise, false. The default is false.

The following example demonstrates the InAir property.

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";
        }
    }
}

.NET Framework
Available since 3.0
Return to top
Show: