DevilAkuma
Active member
- Joined
- Oct 24, 2005
- Messages
- 37
- Programming Experience
- Beginner
I only want to change the color of a word has been typed by the user...
I'm dissapointed with this damned control. I don't know if it's plenty of bugs or I don't know how it works.
In a previous post, I asked how can I know where I was (the position, of course) Well, I got it with this when the user types a space.
With this position, I'm reading (letter by letter) decreasing this endWord until I read another space (or enter, or chars like that). Then, I that situation I have the numberLetters (The number of letters that I decreased from endWord) and the endWord of a word (Just typed by the user) Then I do this.
If I do this... The word (just typed) dissapear! And I don't know why! After that, If I try to write, the color of the letters are red
The I try to append some text...
Don't ask mw why, but with this code runs better. The problem now is that the cursor moves until the end of the text. My function that hanles the myRich.VScroll is called (and I don't know why!)
I only want to change the color of a word has been typed by the user...
Any idea?
Thanks in advance!
I'm dissapointed with this damned control. I don't know if it's plenty of bugs or I don't know how it works.
In a previous post, I asked how can I know where I was (the position, of course) Well, I got it with this when the user types a space.
VB.NET:
Dim endWord As Integer = myRich.SelectionStart
With this position, I'm reading (letter by letter) decreasing this endWord until I read another space (or enter, or chars like that). Then, I that situation I have the numberLetters (The number of letters that I decreased from endWord) and the endWord of a word (Just typed by the user) Then I do this.
VB.NET:
myRich.Refresh()
myRich.SelectionStart() = endWord - numberLetters
myRich.SelectionLength() = numberLetters
myRich.SelectionColor() = Color.Red
If I do this... The word (just typed) dissapear! And I don't know why! After that, If I try to write, the color of the letters are red
The I try to append some text...
VB.NET:
myRich.Refresh()
myRich.SelectionStart() = endWord - numberLetters
myRich.SelectionLength() = numberLetters
myRich.SelectionColor() = Color.Red
myRich.AppendText("")
Don't ask mw why, but with this code runs better. The problem now is that the cursor moves until the end of the text. My function that hanles the myRich.VScroll is called (and I don't know why!)
I only want to change the color of a word has been typed by the user...
Any idea?
Thanks in advance!