Skip to main content
GameDev.net gamedev.net
🔒 Locked

[.net] Richtextbox

Started by Esmo2000 Apr 3, 2007 at 11:43 AM 0 replies 600+ views
Original Post
Esmo2000
Esmo2000
Hello everyone: I have a quick question about rich text box controls in visual basic. I basically want to change the colour of the text in one of these controls, but I can't see another way to do it then use the "Select" command. This basically highlights text and then you can make whichever changes you want. The problem is of course that this has all sorts of unpredictable behaviors which can't be foreseen, and of course, its outright sloppy. The problem is I see no other way to edit the internal data easily! What's the standard correct way to do this sort of thing? Regards, James
We are what we do repeatedly. Excellence, then, is not an act, but a habit.
cignox1
cignox1
A couple of months ago I was searching a way to automatic colouring words (just as a syntax highlighter does) and I found that a quite fast way to do this was directly handling the Rtf property. You add a colour table (or modify it if one is already present) and then add the tags before and after the text you need to colourize. I used csharp and followed a tutorial on codeguru.com. There are a few for VB as well. By the way, I used .Net.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.