RealTimeStylus 构造函数 (Control, Tablet)

初始化 RealTimeStylus 类的新实例,将其附加到指定控件,并将墨迹收集限制为指定的 Tablet。

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

语法

声明
Public Sub New ( _
    attachedControl As Control, _
    tablet As Tablet _
)
用法
Dim attachedControl As Control
Dim tablet As Tablet

Dim instance As New RealTimeStylus(attachedControl, _
    tablet)
public RealTimeStylus(
    Control attachedControl,
    Tablet tablet
)
public:
RealTimeStylus(
    Control^ attachedControl, 
    Tablet^ tablet
)
public RealTimeStylus(
    Control attachedControl,
    Tablet tablet
)
public function RealTimeStylus(
    attachedControl : Control, 
    tablet : Tablet
)

参数

  • attachedControl
    类型:System.Windows.Forms.Control
    附加 RealTimeStylus 对象的控件。如果此参数设置为 null(在 Microsoft Visual Basic .NET 中为 Nothing),则构造函数将引发异常。
  • tablet
    类型:Microsoft.Ink.Tablet
    对其收集墨迹的 Tablet;或为 nullnull 引用(在 Visual Basic 中为 Nothing)(在 Visual Basic 中为 Nothing),以允许对任何附加的 Tablet 进行墨迹收集。

备注

对于新 RealTimeStylus 对象,最初将禁用墨迹收集,并且输入区域设置为 RealTimeStylus 对象附加到的窗口的边界。有关更多信息,请参见 EnabledWindowInputRectangle 属性。

示例

此 Microsoft Visual C# .NET 示例是窗体的 Load 事件处理程序中的代码段,它创建一个附加到 Panel 对象 thePanel 的 RealTimeStylus 对象。仅使用 Tablet 对象 theTablet 进行输入。

using Microsoft.Ink;
using Microsoft.StylusInput;
using Microsoft.StylusInput.PluginData;

// ...

// The panel where the tablet pen data is collected.
private System.Windows.Forms.Panel thePanel;

// The form's Load event handler.
private void theForm_Load(object sender, System.EventArgs e)
{
    // ...

    // Create the RealTimeStylus object.
    this.theRealTimeStylus = new RealTimeStylus(this.thePanel, theTablet);

    // ...
}

平台

Windows Vista, Windows XP SP2, Windows Server 2003

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

版本信息

.NET Framework

受以下版本支持:3.0

另请参见

参考

RealTimeStylus 类

RealTimeStylus 成员

RealTimeStylus 重载

Microsoft.StylusInput 命名空间

Microsoft.Ink.Tablet