code_junkie

How to move scroll bar up by one line? (In C# RichTextBox)

Nov 11th, 2011
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. using System.Runtime.InteropServices;
  2.  
  3. [DllImport("user32.dll")]
  4. static extern int SendMessage(IntPtr hWnd, uint wMsg,
  5. UIntPtr wParam, IntPtr lParam);
  6.  
  7. SendMessage(myRichTextBox.Handle, (uint)0x00B6, (UIntPtr)0, (IntPtr)(-1));
  8.  
  9. RichEdit.SelectionStart = SendMessage(RichEdit.Handle, EM_LINEINDEX, ScrollTo, 0);
  10. RichEdit.ScrollToCaret();
Add Comment
Please, Sign In to add comment