The Tablet PC platform provides two controls, InkEdit and InkPicture, which allow you to easily add ink and handwriting recognition to Tablet PC applications. InkEdit has managed, ActiveX, and Win32 interfaces, while InkPicture has only managed and ActiveX interfaces.
In managed code, create ink controls in the same thread as the main thread for the form. If an InkEdit or InkPicture control is created in a different thread, then your application may not respond properly.
You should explicitly change the threading model to single-thread apartment (STA) before creating an ink control. This causes the control to be created on the main thread. You can use the following Managed C++ code to explicitly set the threading model.
You can use the following code to do the same thing in C#.
System.Threading.Thread.CurrentThread.ApartmentState = System.Threading.ApartmentState.STA;
In managed code, to avoid a memory leak you must explicitly call the Dispose method on any Tablet PC control to which an event handler has been attached before the control goes out of scope.The following sections describe ink controls and the use of ink controls in applications: