I am creating a function that takes the rich textbox and has access to the list of keywords; 'Abuse'. I need to highlight any keywords & amp; I search the RichTextBox User Typing , which means that the function is issued every time an editing key is issued.
I have written this function, but the words and cursors in Box Flickr are too much for comfort.
I have discovered a solution - when I am editing and formatting my text to disable the ability of the rich textbox to re-paint itself. However, the only way I do this is to override the "WndProc" function, and thus reproduce the message as a blocker (which I have collected):
Secure Override Zero WndProc (Ref system.window.form.m) {if (m.msg == 0x00f) {if (paint) base.WndProc (ref m); Other m.Result = IntPtr.Zero; } And base. Weedproc (Ref M); } Boolean 'paint' is set to lie, when I start highlighting and when I finish but as I said, what I used to do I should take it in the rich textbox;
-text "itemprop =" text ">
This is an inspection in the rich textbox class Other controls, such as ListBox, support BeginUpdate and EndUpdate methods to suppress painting. WM_SETREDRAW message is generated in those ways, in fact RTB supports this message, but they forgot to add methods.
Just add them to the project + Add class, paste the code shown below. Compile and leave the control over your form above the toolbox.
using the system; Using System.Windows.Forms; Using System.Runtime.InteropServices; Class MyRichTextBox: Rich Textbox {Public Zero Startup (ADD) {SendMessage (this.Handle, WM_SETREDRAW, (IntPtr) 0, IntPtr.Zero); } Public Zero Endued () {SendMessage (this.Handle, WM_SETREDRAW, (IntPtr) 1, IntPtr.Zero); This.Invalidate (); } [DllImport ("user32.dll")] Private static extern IntPtr SendMessage (IntPtr hWnd, Int msg, IntPtr WP, IntPtr lp); Private Constant WM_SETREDRAW = 0x0b; } Or send text message / PO before text / update.
Comments
Post a Comment