|
Tablet PC Programming Exercise One
|
|
Hello World, Tablet PC Style
Please complete this exercise by January 14. You may do this on a desktop machine with the tablet pc sdk installed. Hopefully, this is still available in the undergraduate computing lab.
Hello world
Hello world is that standard first application to write in a new environment. For the tablet pc version, I would like you to create a program with an inkCollector that allows the user to write Hello World (or anything else!). Provide controls to allow changing the color of the ink. Here is a screen shot of my version.
Hints
Here are the steps I went through to build the application. I would prefer you to use this as a collection of hints when you get stuck, as opposed to a recipe, since there is a lot to be learned from using a new environment. One piece of advice - take small steps and solve problems as you go. Have a working application that you add functionality to continually, as opposed to a busted application that you try to fix at the end.
-
Create C# TpcHello Project
-
Build a form with two panels - inkPanel and controlPanel
- add the panels from the tool box, for inkPanel, set Dock to Top, and for controlPanel, set Dock to Fill
-
Add import statement of Microsoft.Ink
- won't compile, need to add reference to Microsoft.Ink
- right click on TPCHello, add reference. Browse to Program Files/MS TPC SDK/Include/Microsoft.Ink.dll and add reference
-
Add the ink collector
- just two lines of code (in Form's constructor) inkCollector = new InkCollector(inkPanel.Handle);
- inkCollector.Enabled = true;
- Add buttons to contolPanel
- Add SetInkColor method, initialize Color to Blue in Form()
- inkCollector.DefaultDrawingAttributes.Color = color
- Add Button click events (OnBlackClick etc.)
- this is done from the properties form - click on the lightening for the events
- Add SetInkColor to the events.
|
|
Department of Computer Science & Engineering
University of Washington
Box 352350
Seattle, WA 98195-2350
(206) 543-1695 voice, (206) 543-2969 FAX
[comments to anderson]
|