lundi 6 avril 2015

Dynamic checkBox text above checkbox

I am currently creating dynamic checkBoxes and putting them on a panel like this:



CheckBox chk = new CheckBox();
chk.Text = new DirectoryInfo(folder).Name;
chk.Location = new Point(10, i * 25);
panelSubfolders.Controls.Add(chk);
i++;


But on the panel, the text of the checkBox is not directly in the middle of the checkBox rather a bit above of it. How can I fix that? The strange thing is, it doesnt happen for every checkBox I add, some look ok.





Aucun commentaire:

Enregistrer un commentaire