vb.net - Modifying the .net RichTextBox -


I have to do certain things with RichTextBox. I have to add syntax highlighting and I should be able to figure out that Every time the key was pressed, what position was added / removed / inserted Is there any way to edit existing, or is there an open source (pure compatible, preferably VB.net) available for download? I have tried to try my own, the problem is that it will work normally in every function and I do not have enough time to implement it.

Thank you!

There is no need to change the wheel again. To do this, you have two options: First of all, you can hook up in an event that you picked by RichTextBox and what you need there:

  Private sub-rich textbox 1_TextChanged (ByVal Sender as the object, as the system ByVal and System.EventArgs) RichTextBox1 handles the text to 'locate the code' it has been folded Area that was changed to 'most likely that there will be a variable that stores the original text and compare it with' Rich textbox end sub- in  

This has some problems. If you have to use functionality in many forms, then you will repeat code everywhere. You will also need some helpful variables to track this data.

A better solution would be to create your own rich textbox class. Obviously you do not want to start again from scratch, so you can inherit the current class and then expand it how you want it. Accept the public class MyRichTextBox system. Windows .forms .RichTextBox Private Old Text String Protected Overrides Change Text on Sub (System.EventArgs as ByVal e) MyBase.OnTextChanged ( E) If Me.Text; Lt; & Gt; Old text again 'What happened, tell what changes were made if old text = mi Text ending sub-subtax highlighting () '' Add code here and sub end class

MyRichTextBox to highlight syntax at the end of the text box, it should show on Toolbox tab And then you can pull & amp; Leave it on your form.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -