共用方式為


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 方法

ms569352.alert_note(zh-tw,VS.90).gif注意事項:

根據預設,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® Visual Basic® .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