RealTimeStylus Constructor (Control, Tablet)
Initializes a new instance of the RealTimeStylus class, attaches it to the specified control, and restricts ink collection to the specified tablet.
Namespace: Microsoft.StylusInput
Assembly: Microsoft.Ink (in Microsoft.Ink.dll)
Syntax
'Declaration
Public Sub New ( _
attachedControl As Control, _
tablet As Tablet _
)
'Usage
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 function RealTimeStylus(
attachedControl : Control,
tablet : Tablet
)
Parameters
attachedControl
Type: System.Windows.Forms.ControlThe control to which to attach the RealTimeStylus object. If this parameter is set to null (Nothing in Microsoft Visual Basic .NET), the constructor throws an exception.
tablet
Type: Microsoft.Ink.TabletThe tablet on which to collect ink, or nulla null reference (Nothing in Visual Basic) (Nothing in Visual Basic) to allow ink collection on any attached tablet.
Remarks
For new RealTimeStylus objects, ink collection is initially disabled and the input region is set to the bounds of the window to which the RealTimeStylus object is attached. For more information, see the Enabled and WindowInputRectangle properties.
Examples
This Microsoft Visual C# .NET example is a snippet from a form's Load event handler, which creates a RealTimeStylus object attached to the Panel object, thePanel. Only the Tablet object, theTablet, is used for input.
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);
// ...
}
Platforms
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information
.NET Framework
Supported in: 3.0