Hey, ich versuche alles zwischen "" Rot zu makieren:
Das funktioniert auch, nur das problem ist, das ich danach in DarkRed weiterschreibe, wo liegt mein fehler?
C#-Quellcode
- int first = -1;
- int second = -1;
- for (int i = 0; i <= this.TextLength - 1; i++)
- {
- if (this.Text[i] == Convert.ToChar(34))
- {
- if (first == -1)
- {
- first = i;
- }
- else
- {
- second = i;
- }
- if ((second != -1) & (first != -1))
- {
- this.Select(first, second);
- this.SelectionColor = Color.DarkRed;
- second = -1;
- first = - 1;
- this.SelectionStart = selPos;
- this.SelectionColor = Color.Black;
- }
- }
- }
Das funktioniert auch, nur das problem ist, das ich danach in DarkRed weiterschreibe, wo liegt mein fehler?