Bagikan melalui


InkPicture.CollectingInk Property

InkPicture.CollectingInk Property

Gets a value that specifies whether ink is currently being drawn on an InkPicture control.

Definition

Visual Basic .NET Public ReadOnly Property CollectingInk As Boolean
C# public bool CollectingInk { get; }
Managed C++ public: __property bool* get_CollectingInk();

Property Value

System.Boolean. A value that specifies whether ink is currently being drawn on an InkPicture control.

This property is read-only. This property has no default value.

true Ink is being drawn on the InkPicture control.
false Ink is not being drawn on the InkPicture control.

Exceptions

ObjectDisposedException Leave Site:

Remarks

You can use the CollectingInk property to see if ink is being drawn on an InkPicture control rather than monitoring the Stroke event.

Note: Because ink collection is happening on a different thread than your application code, it is possible that the CollectingInk property can change soon after you have checked it. Thus, your code may be operating under the assumption that the InkPicture is not collecting ink, when in fact it is. If this occurs, an error is thrown. To be safe, put such code in a try-catch block.

Examples

[C#]

This C# example returns the CollectingInk value of an InkPicture, theInkPicture, as a Boolean Leave Site, isCollecting.

bool isCollecting = theInkPicture.CollectingInk;

[Visual Basic .NET]

This Microsoft® Visual Basic® .NET example returns the CollectingInk value of an InkPicture, theInkPicture, as a Boolean Leave Site, isCollecting.

Dim isCollecting As Boolean = theInkPicture.CollectingInk

See Also