1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| SuspendLayout();
RadioButton oRdBt = new RadioButton();
PnRadio.Controls.Add(oRdBt);
oRdBt.Text = sLabel;
System.Drawing.Graphics oGraphics = this.CreateGraphics();
oGraphics.PageUnit = GraphicsUnit.Pixel;
SizeF oSizeF = oGraphics.MeasureString(oRdBt.Text, oRdBt.Font);
oRdBt.Size = new Size(Convert.ToInt32(_iWithFix + oSizeF.Width), Convert.ToInt32(_iHeightFix + oSizeF.Height));
oRdBt.Location = new Point(4, (oRdBt.Height + _iRadioButtonInterval) * (PnRadio.Controls.Count-1));
oRdBt.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
//DEBUG
oRdBt.BackColor = Color.Red;
ResumeLayout(true); |
Partager