Pete's Weblog

The Blog Formerly Known as Fun with WinForms

  Home  |   Contact  |   Syndication    |   Login
  14 Posts | 0 Stories | 35 Comments | 100 Trackbacks

News

Archives

Post Categories

.NET Programming

Software

Weblogs

October 2003 Entries


In a comment on the original post of this series, Kollen Glynn points out that I could specify a bounding rectangle to the Invalidate() call in the Stroke method. Here's the code for that alteration, as well as some other performance enhancements...



The key problem with the code in my first post is that it renders all strokes the same. Even if they are selected. If you can tolerate this (it doesn't look too bad as you still get the selection frame), then go ahead and use that code. But here's a better way...


This time I'll be adding a few more properties to the InkPanel, including a way to change the mode of the Ink and some support for changing colours. As an added bonus, I'll add support for separate highlighting including a way to separate the highlights from the ordinary ink.


I recently had the opportunity to watch The .NET Show's latest installment, all about programming for the Tablet PC on .NET. The ease with which they added Ink support to an application in the show inspired me to try it for myself. I started by checking the internet for samples (as you do :) ), and found the Tablet PC Developer website.


As promised earlier, I've added the ability to change the background colour of the text. I've also made one or two minor changes to the rest of the code, which I'll detail at the end.



Microsoft Word and Visual Studio have one very cool feature in common -- squiggly underlining of errors. As of richedit 3.0 (distributed with Windows 2000 and higher, possibly also with ME) we can get these in the RichTextBox. Actually, we can get a lot more underline styles than that...


I've long since given up on using RichTextBox for a code editor, but while I was investigating its use I came across a number of ways to improve it's functionality. I'll present these here in a series of posts on the subject.. first up is how to speed up the control's updating, as well as adding one little extra formatting option.