Achtung Baby

Achtung Baby

Your deep understanding of the platform-managed APIs will help you pick up the ink controls quickly because they expose some of the same interfaces. Before diving into the individual controls, we ll mention a few short but important caveats that apply to both controls.

  • The functionality of these controls is limited on machines not running Microsoft Windows XP Tablet PC Edition.

    You ll probably recall these limitations, which we first mentioned in Chapter 3. The gist is that the two ink controls will not capture, edit, or recognize ink when running on other versions of Windows. A notable exception is that InkPicture captures ink as long as the Tablet PC Platform SDK is installed. But if you deploy your application onto machines running other non-tablet versions of Windows, the controls will lose their ink capture, edit, and recognition capabilities.

  • You must create and use the controls on your application s main thread.

    Both InkEdit and InkPicture will misbehave if they are not created and used on the main thread. This will not be a problem in typical applications since the main thread most often uses UI elements. All Windows Forms controls, for instance, have this restriction as well.

  • The controls have differing capabilities depending on their version.

    There are managed, Microsoft ActiveX, and Microsoft Win32 versions of InkEdit, but there are only managed and ActiveX versions of InkPicture. Variations between the controls are small and are mostly due to differences between Microsoft .NET and ActiveX. For instance, the ActiveX version of InkEdit supplies a BorderStyleConstants enumeration that s unnecessary in the managed version, which instead uses System.Windows.Forms.BorderStyle. On the other hand, only the managed version of both controls has public constructors since ActiveX controls do not have publicly callable constructors.

    IMPORTANT
    A practical implication of these limitations is that the InkEdit samples in this chapter will capture ink only if you run the samples on Windows XP Tablet PC Edition. On all other operating systems, the InkEdit samples will not capture ink.

Other than what we ve just listed, the ink controls behave pretty much like other .NET or ActiveX controls. You can drag them onto forms using Microsoft Visual Studio s form designer or create them programmatically. You can even reference them from a Web page using Microsoft JScript or Microsoft Visual Basic Scripting Edition (VBScript).

More than likely, you are going to add the controls to your application by dragging them onto forms in Visual Studio. However, in the interests of clarity we will continue to programmatically create them in our code listings so that stand-alone C# files are sufficient to compile and run the listings.



Building Tablet PC Applications
Building Tablet PC Applications (Pro-Developer)
ISBN: 0735617236
EAN: 2147483647
Year: 2001
Pages: 73

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net