InkCollector.Enabled Property

Gets or sets a value that specifies whether the InkCollector object collects pen input.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Public Property Enabled As Boolean
'Usage
Dim instance As InkCollector 
Dim value As Boolean 

value = instance.Enabled

instance.Enabled = value
public bool Enabled { get; set; }
public:
property bool Enabled {
    bool get ();
    void set (bool value);
}
public function get Enabled () : boolean 
public function set Enabled (value : boolean)

Property Value

Type: System.Boolean
true if the InkCollector object collects pen input. false if the InkCollector object does not report pen input. No pen-related events fire.

Remarks

In addition to ink, pen input may include in-air packets, cursor in range events, and so on.

The InkCollector object collects ink in Microsoft® Windows® XP Tablet PC Edition or any edition of Windows 2000, Windows Server 2003, or Windows XP on which the Windows XP Tablet PC Edition SDK is installed. However, handwriting recognition occurs only if you use Windows XP Tablet PC Edition. In any edition of Windows 2000, Windows Server 2003, or of Windows XP other than Windows XP Tablet PC Edition, the Enabled property is always false if the Windows XP Tablet PC Edition SDK is not installed.

If the window input rectangle of an enabled InkCollector or InkOverlay (set in the constructor or with the SetWindowInputRectangle method) overlaps the window input rectangle of an InkCollector, a COMException exception is thrown.

Note

Overlap can occur without an error as long as only one of the input rectangles is enabled at anytime.

While a control is not enabled, you receive no events.

When you set the Enabled property of a container control to false, all of its contained controls are disabled as well.

You cannot set the Enabled property to false while the object is collecting ink (CollectingInk property is true.)

The Enabled property must be set to false before setting or calling specific properties and methods of the object. If you try to change the specified properties or call the specified methods, an error occurs.

The following properties and methods cannot be set or called unless the Enabled property is first set to false:

You should set the Enabled property for an InkCollector object to false before you shut down an application.

Note

This function can be re-entered if the Enabled property is set within certain message handlers, causing unexpected results. Take care to avoid a reentrant call when handling any of the following messages: WM_ACTIVATE, WM_ACTIVATEAPP, WM_NCACTIVATE, WM_PAINT; WM_SYSCOMMAND if wParam is set to SC_HOTKEY or SC_TASKLIST; and WM_SYSKEYDOWN (when processing Alt-Tab or Alt-Esc key combinations). This is an issue with single-threaded apartment model applications.

Examples

This C# example creates an InkCollector object and enables it.

using Microsoft.Ink;
//...
InkCollector theInkCollector = new InkCollector(Handle);
theInkCollector.Enabled = true;
//...

This Microsoft Visual Basic .NET example creates an InkCollector object and enables it.

Imports Microsoft.Ink
'...
Dim theInkCollector As New InkCollector(Handle)
theInkCollector.Enabled() = True
'...

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

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

See Also

Reference

InkCollector Class

InkCollector Members

Microsoft.Ink Namespace

InkCollector.Handle

InkCollector.Ink

InkCollector.MarginX

InkCollector.MarginY

InkCollector.SetAllTabletsMode

InkCollector.SetSingleTabletIntegratedMode

InkCollector.CollectingInk