Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
InkCollector Class
InkCollector Events
 SystemGesture Event
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
InkCollector..::.SystemGesture Event

Occurs when an InkCollector object recognizes a system gesture.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)
Visual Basic (Declaration)
Public Event SystemGesture As InkCollectorSystemGestureEventHandler
Visual Basic (Usage)
Dim instance As InkCollector
Dim handler As InkCollectorSystemGestureEventHandler

AddHandler instance.SystemGesture, handler
C#
public event InkCollectorSystemGestureEventHandler SystemGesture
Visual C++
public:
 event InkCollectorSystemGestureEventHandler^ SystemGesture {
    void add (InkCollectorSystemGestureEventHandler^ value);
    void remove (InkCollectorSystemGestureEventHandler^ value);
}
JScript
JScript does not support events.

System gestures give information about the Cursor object that is being used to create the gesture. They also provide shortcuts to combinations of mouse events and are effective ways to detect mouse events.

For example, instead of listening for a pair of MouseUp and MouseDown events with no other mouse events occurring in between, listen for the Tap or RightTap system gestures.

As another example, instead of listening for MouseDown and MouseMove events and getting numerous MouseMove messages, you can listen for the Drag or RightDrag system gestures as long as you have no need for the (x, y) coordinates of every position of the mouse. This allows you to receive only one message instead of numerous MouseMove messages.

For a list of specific system gestures, see the SystemGesture enumeration type. For more information about system gestures, see Pen Input, Ink, and Recognition.

The event handler receives an argument of type InkCollectorSystemGestureEventArgs that contains data about this event.

When you create an InkCollectorSystemGestureEventHandler delegate, you identify the method that handles the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate.

The event handler in this example displays system gesture information on a status bar label, statusLabelSysGesture.

Visual Basic
Private Sub Event_OnSystemGesture(ByVal sender As Object, ByVal e As InkCollectorSystemGestureEventArgs)
    Select Case e.Id
        Case SystemGesture.Tap
            Me.statusLabelSysGesture.Text = "Tap"
        Case SystemGesture.DoubleTap
            Me.statusLabelSysGesture.Text = "Double Tap"

    End Select
End Sub
C#
private void Event_OnSystemGesture(object sender, InkCollectorSystemGestureEventArgs e)
{
    switch (e.Id)
    {
        case SystemGesture.Tap:
            this.statusLabelSysGesture.Text = "Tap";
            break;
        case SystemGesture.DoubleTap:
            this.statusLabelSysGesture.Text = "Double Tap";
            break;
    }

}

Prior to collection of system gestures, the InkCollector object, mInkCollector registers the event handler.

Visual Basic
' register the SystemGesture event handler
AddHandler mInkCollector.SystemGesture, New InkCollectorSystemGestureEventHandler(AddressOf Event_OnSystemGesture)
C#
// register the SystemGesture event handler
mInkCollector.SystemGesture += new InkCollectorSystemGestureEventHandler(Event_OnSystemGesture);

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker