Hi dunkonu,
This sounds a bit like homework assignment so I will explain in general
terms.
I apologize if I am wrong.
I wouldn't use a TextBox to draw the rectangle. You can draw it directly on
the form the user is inputting the width and height on. I would probably
use
a panel as a drawing control.
When the user has finished entering the size put some code in click event on
a button marked "Draw". In this event obtain a graphics object of either
the
form or the panel (the control you want to draw on).
You can use Graphics.DrawRectangle on this control.
Remember that the rectangle will be cleared if you move something in front
of the control. To keep the rectangle put the drawing code inside the
control's
Paint event or call the drawing code from the Paint event.
Tell us if you want more detailed description.
Happy Coding!
Morten Wennevik [C# MVP]