Quantcast
Channel: SharpDevelop Community
Viewing all articles
Browse latest Browse all 1764

WPF Avalon Edit Make text upper case

$
0
0

I am using C# WPF with Avalon Edit Text Box.

I am trying to make all of the text in the text box uppercase and I get an error with additional message 'No undo group should be open at this point'.

 

I am using the following code:

a.Text = a.Text.ToUpper();

where "a" is the AvalonEdit.TextEditor.

The code is inside the 'TextChanged' Event handler.

 

I have also tried this answer on Stack Overflow to end the undo group, but this didn't work for me. I also tried putting this code into try ... catch blocks in various ways but got nowhere.

 

All I am trying to achieve is making the TextEditor.Text property completely uppercase whether the user inputs uppercase characters or not. If there is a fix or a better way to achieve this please let me know.

 

Thank you.

 


Viewing all articles
Browse latest Browse all 1764

Trending Articles