初始化 InkOverlay 類別的新執行個體,再將它附加至指定的視窗控制代碼,然後判斷是否使用滑鼠進行輸入。
命名空間: Microsoft.Ink
組件: Microsoft.Ink (在 Microsoft.Ink.dll 中)
語法
'宣告
Public Sub New ( _
handle As IntPtr, _
useMouseForInput As Boolean _
)
'用途
Dim handle As IntPtr
Dim useMouseForInput As Boolean
Dim instance As New InkOverlay(handle, _
useMouseForInput)
public InkOverlay(
IntPtr handle,
bool useMouseForInput
)
public:
InkOverlay(
IntPtr handle,
bool useMouseForInput
)
public InkOverlay(
IntPtr handle,
boolean useMouseForInput
)
public function InkOverlay(
handle : IntPtr,
useMouseForInput : boolean
)
參數
- handle
型別:System.IntPtr
附加 InkOverlay 物件之視窗的控制代碼。
- useMouseForInput
型別:System.Boolean
設定為 true 表示使用滑鼠進行手寫板輸入,否則為 false。
備註
新建立的 InkOverlay 可以在指定的視窗介面上收集筆墨。
安全性注意事項: |
|---|
如果在部分信任的情況下使用,除了 InkOverlay 所需的權限之外,這個建構函式還需要 SecurityPermissionFlag.UnmanagedCode 權限。如需詳細資訊,請參閱Security and Trust。 |
範例
這個 C# 範例會初始化 InkOverlay 物件 (變數名稱為 theInkOverlay) 的新執行個體,再使它與表單的視窗控制代碼產生關聯,接著指出滑鼠不用於輸入,然後啟用這個執行個體。
using System;
using System.Drawing;
using System.Windows.Forms;
using Microsoft.Ink;
class MinimumInkApp : System.Windows.Forms.Form
{
InkOverlay theInkOverlay;
public MinimumInkApp()
{
// Initialize the form.
this.Text = "Minimum Ink Application";
// Create and enable theInkOverlay.
theInkOverlay = new InkOverlay(Handle, false);
theInkOverlay.Enabled = true;
}
public static void Main()
{
Application.Run(new MinimumInkApp());
}
}
這個 Microsoft Visual Basic .NET 範例會初始化 InkOverlay 物件 (變數名稱為 theInkOverlay) 的新執行個體,再使它與表單的視窗控制代碼產生關聯,接著指出滑鼠不用於輸入,然後啟用這個執行個體。
Imports System.Windows.Forms
Imports Microsoft.Ink
Public Class MinimumInkApp
Inherits System.Windows.Forms.Form
Dim theInkOverlay As InkOverlay
Public Sub New()
MyBase.New()
'Initialize the form.
Me.Text = "Minimum Ink Application"
'Create and enable theInkOverlay.
theInkOverlay = New InkOverlay(Handle, False)
theInkOverlay.Enabled = True
End Sub
Public Shared Sub Main()
Application.Run(New MinimumInkApp())
End Sub
End Class
平台
Windows Vista
.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求。
版本資訊
.NET Framework
支援版本:3.0
安全性注意事項: