I created a UserControl (Windows Forms)...
Then in form1 designer I have a GroupBox and when I'm dragging the new UserControl (DownloadInformation) over the GroupBox the UserControl size is changing and get bigger than what I have set it.
This screenshot is of the UserControl designer, the size is 216, 117:

And this screenshot is when I drag the UserControl in form1 designer and it is in the size I wanted it to be:

And this screenshot is when I drag the UserControl inthe form1 designer of the GroupBox on the left side:
Th size of the UserControl has changed and also the content lines space and everything.
How can I keep the UserControl size when dragging it over the GroupBox?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace My_Test
{
public partial class DownloadInformation : UserControl
{
public DownloadInformation()
{
InitializeComponent();
var flp = new FlowLayoutPanel
{
Width = 216,
Height = 117,
Location = new Point(10, 10),
Font = new Font("Microsoft Sans Serif", 14)
};
Controls.Add(flp);
// Put the labels to the dictionary for better processing.
var labels = new Dictionary<string, string>
{
{ "Size:", "1.211 MB" },
{ "Downloaded:", "0.727 MB" },
{ "Images left:", "4" },
{ "Speed:", "1.79 MB/s" },
};
// Go through each label
foreach (var line in labels)
{
// Each line consists of two labels: Text + Value
// Each label has its own color.
flp.Controls.Add(new Label() { Text = line.Key, ForeColor = Color.Green });
flp.Controls.Add(new Label() { Text = line.Value, ForeColor = Color.Red });
// Break after each line
flp.SetFlowBreak(flp.Controls[flp.Controls.Count - 1], true);
}
}
private void DownloadInformation_Load(object sender, EventArgs e)
{
}
}
}