Meet Edwina, a text editor with more features than Notepad or WordPad. Your mission in this chapter is to create Edwina with as few lines of code as possible. After you create this text editor, you might want to go a step further and clone Edwina and then turn the clone into Edwina II (EdII for short), a Multiple Document Interface (MDI) editor with the same features as Edwina. For EdII, the challenge is to change as few lines of Edwina code as possible—in fact, all the changes should relate to MDI, not to editing. The ultimate mission would be to put either an editor or a file viewer with any or all of Edwina’s features into any application you want with as much flexibility and as little code as possible.
You might point out that there are already many fine editor controls on the market, and many of them have features far beyond anything we could add in one chapter, even if it is a hardcore chapter. We’re not going to attempt redefinition of editing keys, extended editing commands, multiple levels of undo, or many of the other sophisticated features available. But these features are probably overkill if your applications need only simple text editing or viewing features. If the features of Notepad, WordPad, or the Visual Basic editor look adequate, you probably don’t need the extra expense and overhead of a third-party editor control. You can write your own in Visual Basic.
NOTE I regret to announce the death of Edwina’s older brother, Edward. Some of you might remember Edward from the previous edition of this book. The poor devil was based on a TextBox and wore a fake toolbar and status bar made of (don’t laugh) 3D panel controls. He was a tough little guy who preferred camping out in the 16-bit wilderness. Although he sometimes visited Windows 95 and Windows NT, he never felt at home there and died of a broken heart when the last 64K segment rolled off the assembly line.