I try to understand the sizing behaviour of a windows forms window. For example, the following code results in a window that has some margin to the bottom and right.
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
FlowLayoutPanel verticalPanel = new FlowLayoutPanel();
verticalPanel.BorderStyle = BorderStyle.FixedSingle;
Controls.Add(verticalPanel);
AutoSize = true;
}
}
}
The code results in the following form:
What do I need to do in order to make the window end at the minimum possible size, i.e., at the border of the flow layout panel?
Edit: I don't want to fix the dialog to its minimum size, only set it during initialization.