Hallo,

wie kann ich die beiden "Test" strings in der Zeichenkette "test des testens test" farbig hervorheben?
mit folgenden code habe ich leider kein erfolg gehabt:
verwende VS2005
Danke für Hilfe.

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
private: System::Void richTextBox1_TextChanged(System::Object^  sender, System::EventArgs^  e)
             {
                int idx;
                
                idx = this->richTextBox1->Find("test", RichTextBoxFinds::WholeWord);
                if (idx >= 0)
                {
                    this->richTextBox1->Select(idx,4);
                    this->richTextBox1->SelectionFont = gcnew System::Drawing::Font("Verdana", 12, FontStyle::Bold);
                    this->richTextBox1->SelectionColor = Color::Red;
                } else {
                    this->richTextBox1->SelectionColor = Color::Black;
                }
                
                this->richTextBox1->Select(this->richTextBox1->Text->Length,0);
                this->richTextBox1->SelectionColor = Color::Black;
                this->richTextBox1->ScrollToCaret();
             }