Using Tablet PC Ink on Windows Controls in VB.NET

Any Windows Forms control including a Form itself can be used as a surface to draw using the Tablet PC pen and ink. In this article, I will discuss how to use the Ink functionality to write on various Windows Forms controls.
  • 3430
 

You can use any control as a surface for the ink and can write on these controls using a Tablet PC pen. To make control ink enabled, you must have to assign the handle of the control to InkOverlay handle.

For example, the following code sets a button as ink overlay control. So you can write on the button using Tablet PC pen.

Dim inkOverlay As New InkOverlay()
inkOverlay.Handle = button1.Handle
inkOverlay.Enabled =
True

InkOnControlsImg4.jpg

Using the above code, only one control can be used at a time. For example, if we replace the above code with the following, only DataGrid control will support the ink overlay.

Dim inkOverlay As New InkOverlay()
inkOverlay.Handle = button1.Handle
inkOverlay.Handle = dataGrid1.Handle
inkOverlay.Enabled =
True

If you want to make the Form as default drawing surface, you can assign Form's handle to the InkOverlay's handle using the following code:

inkOverlay.Handle = form1.Handle

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.