A ScrollBarRenderer is only used to draw a scrollbar, it doesn't actually perform any scroll calculations nor actions.
Personally, I find the HScrollBar and VScrollBar rather clumsy controls to work.
Inheriting from the ScrollableControl (or Panel to get a built-in windows control border) is probably the easiest. You use the AutoScrollMinSize property to set the size of the interior surface, and then perform a TranslateTransform on the graphics object using the AutoScrollPosition property to handle the "where" to draw part of the control:
public class ScrollControl : ScrollableControl {
public ScrollControl() {
this.DoubleBuffered = true;
this.ResizeRedraw = true;
this.AutoScrollMinSize = new Size(0, 600);
}
protected override void OnPaint(PaintEventArgs e) {
base.OnPaint(e);
e.Graphics.Clear(Color.White);
e.Graphics.TranslateTransform(this.AutoScrollPosition.X,
this.AutoScrollPosition.Y);
e.Graphics.FillRectangle(Brushes.Red, new Rectangle(16, 32, 64, 32));
}
}
Be careful though, a syntax text editor is a different beast that a drawing control. I would advise using a RichTextBox control for that.