I had to write an editor for a project I'm working on, and I figured since it was already done and enough of it was a PITA to run down (for me anyhow) I might as well post the project here if anyone has a use for it.
Features:
- File load/save (didn't need this but added just for forum folks )
- Keeps track of whether you've saved since changing text
- Font control
- Size control
- Indent/outdent
- Undo
- Left/Center/Right alignment
- Toolbar auto-updates when cursor position moves
- System fonts are read and their short names extracted into a combobox at runtime
- Pretty heavily commented
Notes:
- No printing, sorry, not on my plate, although printing isn't that hard to add to richtextbox apps
- The two comboboxes for font and size appear to be contained by the toolbar, but in fact they are not; I cheated and just placed them carefully. On some systems they might not draw in quite the correct place.
- No try/catch blocks. Wasn't especially on my agenda either, as the version of the editor I'm using doesn't work with files and exceptions are unlikely enough that I don't really care about them at this point.
- It may be that some of my code is very amateurish. Oh well!
Have fun. Dedicated to all those who have helped me tremendously at various times in the past (edneeis, hellswraith, mrpolite and others)
After all the good stuff I've gotten out of this forum it's the least I can do. I just hope somebody gets some use out of it. Writing an editor turned out to be unexpectedly hard But not too bad, took about a day and a half to do it. Thanks for the feedback!
Here is a package of the icons you used plus a couple other common ones, but with transparent backgrounds so they jive with my xp theme. Thanks for the RTF Editor.
Aha thanks a ton, finding the icons was actually the hardest part! The ones included with the environment are in bitmap format and as you say they don't have transparent backgrounds, plus I had to cut/paste the indent/outdent buttons