Я создаю несколько радиокнопок программно в цикле.Я установил несколько его свойств и в конце добавляю вновь созданный RadioButton в список Form.Controls.Перед тем, как добавить RadioButton в Form.Controls, его свойство Height равно 24. Через одну строку после добавления RadioButton в Form.Controls его свойство Height равно 29. Вот цикл:
for (int i = 0; i < numberOfRadioButtons; i++)
{
RadioButton currentRadioButton = new RadioButton();
currentRadioButton.Font = new Font("Times New Roman", 16, FontStyle.Bold);
currentRadioButton.Name = "radioButton" + (i + 1).ToString();
currentRadioButton.Text = currentRadioButton.Name;
currentRadioButton.AutoSize = true;
int currentRadioButtonHeight = currentRadioButton.Height; // 24
this.Controls.Add(currentRadioButton);
currentRadioButtonHeight = currentRadioButton.Height; // 29
}
Я не понимаю, как добавление элемента управления в Form.Controls изменяет значение высоты элемента управления.Пожалуйста помоги.Заранее спасибо.