Scrolling isn't too hard - but it's not trivial either. I'll give you some starting points, but the actual implementation will depend on the structure of your game.
To begin with, you need your scroll region (probably a
Rectangle), the scroll offset of the content within that region (probably
int), and the length of the scrollable content (probably
Then you need a way to clip your scrolling content to display only within the scroll region. This means
ScissorRectangle, or a stencil buffer if you want a non-rectangular region.
Viewport will change the origin of the display, whereas
ScissorRectangle just clips.
To make your content move up and down within this region, use a translation matrix (
Matrix.CreateTranslation). If you use
Begin method has an overload that takes a transformation matrix (MSDN).
To determine whether clicking is happening within the scroll region, use
Rectangle.Contains. You can also use this to determine whether the user is clicking on your scroll bar.
If you want scroll-wheel support, use
Mouse.ScrollWheelValue (note that this is a cummulative value, see MSDN).
You'll have to do all the maths for the scrolling yourself, but it should be fairly simple.
Math.Max should help to keep your scroll offset in the desired bounds. You can calculate the height for your scrollbar with something like:
(int)Math.Max(1, (float)region.Height / (float)content.Height)