Hello!
I want to add syntax Highlighting to my TextView and i made a prototype to detect if text has changed. I tried using editor.TextChanged but that didn' work. Do you guys have another idea how to accomplish my goal? Anyways,
Here is the code i tried it with
editor.TextChanged += () =>
{
System.Windows.Forms.MessageBox.Show("Text Changed");
};
This does not work.
I would appreciate help, thank you.
UPDATE: Pressing CTRL will bring the MessageBox to show and it pastes using System.Windows.Forms; in the TextView then
TextChangedonly fires if the Textproperty is changed and not when you are typing, because you don't want to save the changes. But there must be a Changedevent just to notify the user that they can get the changes with get method Text.
If you want to do syntax highlighting you might want to inherit from TextView and override ReDraw?
I think it would be better to ask about possible ways to pull off syntax highlighting instead.
Most helpful comment
I think it would be better to ask about possible ways to pull off syntax highlighting instead.