# Render only some of graphics?

In XNA I am building my own textbox, and listbox.

For the textbox, I want it to render all text it can, and then cut off at the end of the textbox. But I don't want it to cut whole letters. I want it to cut exactly where the pixel limit is, so that if I write "SPAAAAAAAACE", and the size is 50 for instance, then it will only render "SPAAAA" and then a half A, or whatever is remaining in the pixels.

For my listbox, it's kind of the same thing. If I am scrolled half down, one element needs to be only half-visible.

How can I do this? Is it possible to add something to a buffer, and then before drawing it, clearing a specific rectangle from the buffer again?

Set your GraphicsDevice.Viewport or GraphicsDevice.ScissorRectangle so that you are only drawing over the top of your text area. You must be outside of a sprite-batch when you do this (ie: between end and begin). Remember to set it back when you're done.
Remember that SpriteBatch's drawing area covers the viewport (so (0,0) is the top-left of the viewport).