I have a form with a panel, the panel has a textbox and two buttons
This is the size I want the form to be.
But if I do this.Size = pnl.Size;
Then it comes too small
Here is a programmatically generated example on form load
Panel pnl = new Panel();
pnl.Size=new Size(200, 100);
pnl.Location = new Point(0, 0);
Button b1 = new Button();
Button b2 = new Button();
TextBox t1 = new TextBox();
b1.Text = "OK";
b1.Location = new Point(3, 58);
b1.Size = new Size(75, 23);
b2.Text = "Cancel";
b2.Location = new Point(103, 58);
b2.Size = new Size(75, 23);
t1.Location = new Point(0, 0);
t1.Size = new Size(200, 50);
t1.Multiline = true;
pnl.Controls.Add(b1);
pnl.Controls.Add(b2);
pnl.Controls.Add(t1);
this.Controls.Add(pnl);
this.Size = pnl.Size;
That last line, this.Size = pnl.Size
isn't making the form big enough. How can I get the form to fit properly like in the first picture? (preferably without having to do lots of arithmetic and without manually figuring it out graphically then inserting the number in)