Share via


InkEdit.GetGestureStatus 方法

返回一个值,该值指示 InkEdit 对象是否关注特定的应用程序笔势

命名空间:  Microsoft.Ink
程序集:  Microsoft.Ink(在 Microsoft.Ink.dll 中)

语法

声明
Public Function GetGestureStatus ( _
    gesture As ApplicationGesture _
) As Boolean
用法
Dim instance As InkEdit
Dim gesture As ApplicationGesture
Dim returnValue As Boolean

returnValue = instance.GetGestureStatus(gesture)
public bool GetGestureStatus(
    ApplicationGesture gesture
)
public:
bool GetGestureStatus(
    ApplicationGesture gesture
)
public boolean GetGestureStatus(
    ApplicationGesture gesture
)
public function GetGestureStatus(
    gesture : ApplicationGesture
) : boolean

参数

返回值

类型:System.Boolean
一个指示 InkEdit 控件是否关注特定应用程序笔势的值。

含义

true

InkEdit 控件关注该笔势。识别笔势时将引发 Gesture 事件。

false

InkEdit 控件不关注该笔势。

备注

如果 gesture 参数设置为 ApplicationGesture,则此方法将引发异常。

若要设置 InkEdit 控件对特定笔势的关注,请调用 SetGestureStatus 方法。

备注

默认情况下,InkEdit 控件关注以下应用程序笔势:

示例

此 C# 示例创建一个 ArrayList,其中包含 InkEdit 控件 theInkEdit 关注的所有应用程序笔势。

using Microsoft.Ink;
// . . .
// Return an array of all of the ApplicationGestures that
// have their status set to true on the InkEdit control.
private ApplicationGesture [] GetSetAppGestures(InkEdit theInkEdit)
{
    ArrayList result = new ArrayList();
    ApplicationGesture test = ApplicationGesture.NoGesture;
    Array gestureArray = System.Enum.GetValues(test.GetType());
    foreach (ApplicationGesture theGesture in gestureArray)
    {
        // ApplicationGesture.AllGestures is not a meaningful 
        // gesture to pass to GetGestureStatus()
        if (theGesture != ApplicationGesture.AllGestures && 
            theInkEdit.GetGestureStatus(theGesture))
        {
            result.Add(theGesture);
        }
    }
    return (ApplicationGesture[])result.ToArray(typeof(ApplicationGesture));
}

此 Microsoft(R) Visual Basic(R) .NET 示例创建一个 ArrayList,其中包含 InkEdit 控件 theInkEdit 关注的所有应用程序笔势。

Imports Microsoft.Ink
' . . .
' Return an array of all of the ApplicationGestures that
' have their status set to true on the InkEdit control.
Private Function GetSetAppGestures(ByVal theInkEdit As InkEdit) _
    As ApplicationGesture()
    Dim result As New ArrayList()
    Dim test As ApplicationGesture = ApplicationGesture.NoGesture
    Dim theGestures As Array = System.Enum.GetValues(test.GetType())
    Dim theGesture As ApplicationGesture
    For Each theGesture In theGestures
        ' ApplicationGesture.AllGestures is not a meaningful 
        ' gesture to pass to GetGestureStatus()
        If (Not theGesture.Equals(ApplicationGesture.AllGestures)) AndAlso _
            theInkCollector.GetGestureStatus(theGesture) Then
            result.Add(theGesture)
        End If
    Next
    Return CType(result.ToArray(test.GetType()), ApplicationGesture())
End Function

平台

Windows Vista

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

InkEdit 类

InkEdit 成员

Microsoft.Ink 命名空间

ApplicationGesture

InkEdit.Gesture

InkEdit.SetGestureStatus