Reader Level:

My First Tablet PC Application using C#

By Mahesh Chand on May 24, 2004
This step by step tutorial shows you how to create your first Tablet PC application using Visual Studio .NET and C# with the help of Microsoft Tablet PC API.

This step by step tutorial shows how to create our first Tablet PC application.

1. Create a new Windows application using Visual Studio .NET. I call my project "HelloTabletPC".

2. To use the Tablet PC functionality in our application, we have to add reference to the Tablet PC API, which provides access to the library that contains the functionality to access Tablet PC. As you can see from following Figure, I select Microsoft Tablet PC API on the Add Reference dialog and click OK.

Which adds Microsoft.Ink namespace to our References list as you can see from the following figure.

3. The Tablet PC Ink functionality of Tablet PC is defined in the Microsoft.Ink namespace. So we include the namespace in our application by adding the following line of code.

using Microsoft.Ink;

4. Now we write code to enable Ink overlay on the form so we can use Ink or mouse to write on the Form. On the Form's load event handler, we write the following code:

InkOverlay inkOverlay = new InkOverlay();
inkOverlay.Handle= this.Handle;
inkOverlay.Enabled = true;

This code enables the ink overlay on the form. Which means you can use pen to write on the Form.

5. Now using pen, I write the following on the form. You can even use the mouse.

That's it. 

Mahesh Chand
Mahesh Chand

C# Corner founder, 10-times Microsoft MVP, technical author, and software architect. Mahesh authored his first book, A Programmer’s Guide to ADO.NET in C# with APress at the age of 25. C# Corner is a memb... Read more



JetBrains ReSharper Ultimate
.NET code analysis, refactorings, navigation, unit testing, code coverage and profiling in Visual Studio, a bonus for C++ devs, bundled at 50% off.

Trending up

Infragistics jQuery Controls