RichTextBox controls that support synchronous scrolling

Source: Internet
Author: User

usingSystem.Windows.Forms; Public classsynchronizedscrollrichtextbox:system.windows.forms.richtextbox{ PublicSynchronizedscrollrichtextbox Synchronized {Get;Set; }  Public Const intWm_vscroll =0x115;  Public Const intEm_linescroll =0xb6; protected Override voidWndProc (refSystem.Windows.Forms.Message msg) {        if(Msg. MSG = = Wm_vscroll | | Msg. MSG = =em_linescroll) {            if(Synchronized! =NULL) {Message message=msg; Message. HWnd=Synchronized.handle; Synchronized.pubwndproc (refmessage); }        }        Base. WndProc (refmsg); }     Public voidPubwndproc (refSystem.Windows.Forms.Message msg) {        Base. WndProc (refmsg); }}

The above code, copied into the project, compiled once, dragged onto the form, for example, drag 2 instances, and then set the Synchronized property to each other in the design interface. The two text boxes can be scrolled synchronously after running.

RichTextBox controls that support synchronous scrolling

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.