Hi!
I'm just writing a very simple XML editor. I have a TextBox instance as a editing panel. How can I change the color of tags? My goal is, that when I press '<' -key (in TextBox), this and the next characters would be blue, and when I press '>' -key, the next characters would be black again.
I have a method, which catch pressed key.
private void keyPressed(object sender, KeyPressEventArgs ex)
{
switch(ex.KeyChar)
{
case '<':
{
this.TBselect.ForeColor = System.Drawing.SystemColors.HotTrack;
break;
}
default:
{
break;
}
}
}
but this changes ALL text.
What should I do, or should I raise my hands up?
br.
Juha K
I'm just writing a very simple XML editor. I have a TextBox instance as a editing panel. How can I change the color of tags? My goal is, that when I press '<' -key (in TextBox), this and the next characters would be blue, and when I press '>' -key, the next characters would be black again.
I have a method, which catch pressed key.
private void keyPressed(object sender, KeyPressEventArgs ex)
{
switch(ex.KeyChar)
{
case '<':
{
this.TBselect.ForeColor = System.Drawing.SystemColors.HotTrack;
break;
}
default:
{
break;
}
}
}
but this changes ALL text.
What should I do, or should I raise my hands up?
br.
Juha K