InkPicture.GetGestureStatus 方法

返回一个值,该值指示 InkPicture 控件是否关注特定的应用程序笔势

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

语法

声明
Public Function GetGestureStatus ( _
    gesture As ApplicationGesture _
) As Boolean
用法
Dim instance As InkPicture
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
一个指示 InkPicture 控件是否关注特定应用程序笔势的值。

含义

true

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

false

InkPicture 控件不关注该笔势。

备注

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

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

备注

默认情况下,InkPicture 控件不关注任何应用程序笔势。

示例

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

[C#]

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

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

[Visual Basic]

Imports Microsoft.Ink
' . . .
' Return an array of all of the ApplicationGestures that
' have their status set to true on the InkPicture object.
Private Function GetSetAppGestures(ByVal theInkPicture As InkPicture) As ApplicationGesture()
    Dim result As New ArrayList()
    Dim sampleGesture As ApplicationGesture = ApplicationGesture.NoGesture
    Dim theGestures As Array = System.Enum.GetValues(sampleGesture.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 _
            theInkPicture.GetGestureStatus(theGesture) Then
            result.Add(theGesture)
        End If
    Next
    Return CType(result.ToArray(sampleGesture.GetType()), ApplicationGesture())
End Function

平台

Windows Vista

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

InkPicture 类

InkPicture 成员

Microsoft.Ink 命名空间

ApplicationGesture

InkPicture.Gesture

InkPicture.SetWindowInputRectangle