   .NET ScrollBars
  Recently I was tinkering with a small application in C#, and during the process it occurred to me that I wanted a scrollbar for a RichEditBox that was independent of the control itself: (that is, a VScrollBar that is used to control the RichEditBox) That it should be physically separated from the control itself, but otherwise able to control the content of the RichEditBox like normal. However, as far as I can identify, the Microsoft APIs seem to completely neglect exposing this sort of functionality. The ONLY method I can find to control the scroll position of a RichEditControl is using ScrollToCaret, which automatically scrolls until some given character index is visible. This is absolutely not enough control for my purposes, and aside from that it seems ridiculously sloppy that I should need to store the old selection values, select something just to change the scroll position, then reselect the old values just to change position. It also means there is absolutely no way to duplicate the smooth scrolling, down to parts of lines, that occurs with the normal scroll bar.Is there some way to gain more complete control over the scroll position of a RichEditBox without using ScrollToCaret? Or would I have to effectively write my own RichEditBox control to achieve this? Is there some other control I should be using that encompasses the same display capabilities, but is less of a hassle to control in code?   
  You could try sending the scroll-related WM_..... messages directly to the control's HWND (you can still do that in C#), but there's no guarantee that something as wacky as a RTB will listen to those messages.   ;Quote:Original post by Arek the AbsoluteRecently I was tinkering with a small application in C#, and during the process it occurred to me that I wanted a scrollbar for a RichEditBox that was independent of the control itself: (that is, a VScrollBar that is used to control the RichEditBox) That it should be physically separated from the control itself, but otherwise able to control the content of the RichEditBox like normal. However, as far as I can identify, the Microsoft APIs seem to completely neglect exposing this sort of functionality. The ONLY method I can find to control the scroll position of a RichEditControl is using ScrollToCaret, which automatically scrolls until some given character index is visible. This is absolutely not enough control for my purposes, and aside from that it seems ridiculously sloppy that I should need to store the old selection values, select something just to change the scroll position, then reselect the old values just to change position. It also means there is absolutely no way to duplicate the smooth scrolling, down to parts of lines, that occurs with the normal scroll bar.Is there some way to gain more complete control over the scroll position of a RichEditBox without using ScrollToCaret? Or would I have to effectively write my own RichEditBox control to achieve this? Is there some other control I should be using that encompasses the same display capabilities, but is less of a hassle to control in code?There's no way to do this without resorting to the Win32 API or ScrollToCaret(). This is one of the more annoying omissions, in my view. But there are lots of third-party controls (derived from RichTextBox) that do a more complete job, like this one.hope that helps,   