Skip to content

Re:How to handle KeyEvents in a RichTextBox

sastry

Asked Aug 1, 2007, 3:25 AM EDT2 answers
Share
LinkedInX

hi,

i am showing two different files in two different RichTextBoxes.I highlighted the difference between the two files.but now when the user Presses F4 i have to scroll directly to the highlighted text..and one more thing is it possibleto Scroll two rich Text boxes at the same time.

Thanks in advance,

sastry

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Mike Gold
    0

    1.  use KeyPress and KeyDown event handlers to handle f4.

    2.  To Scroll to an item in a rich text box,  first select it, then use ScrollToCaret

    richTextBox1.Select(index, 0);
    richTextBox1.ScrollToCaret();

    0
  • 0

    hi thanks mike,

    i got the code...for moving two scroll bars at the same time ...i gone to one rich text box VScroll event and in that i did my coding...one more time thanks for your support

     

    regards,

    sastry

    0