c# - Finding the char index of a Font Style in a RichTextBox -


I am looking for an effective way to find the character index of various font styles in RichTextBox. I have the following:

 for  (var i = 0; i & lt; index; i ++) {_activeCopyBox.Select (i, 1); If (! LinkFound & Active Copx SelectionFont.Underline) UnderLineFound = true; }  

It is very slow because it has to select each letter at a time. I can get formatting from RFT, but trying to find the correct indicator by mistake can be used to embrace this way.

If someone knows better (should be one) I would love to hear

I think That's what you want. RTF property, it gives you the built-in RTF information, which contains all the special tags, and as such the ones outlined and bold and otherwise format information in RichTextBox.

Here is a link to the RTF markup, which may be of any help to you, more efficiently:

'underlined' and Search for 'bold' and you'll see how it works.

To get as much information as you want quickly and efficiently, it is most likely to use regular expressions.

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -