关于Winform自定义控件new Point后没显示
本帖最后由 caozhy 于 2013-02-23 14:21:33 编辑 实现RadioButtonList自定义WinForm控件后调试数据都正常了,在最后
void DrawControl()
{
panel1.Controls.Clear();
int count = _mappings.Length;
//Draw and set control
int height = 0;
int x_aris = 50;
int y_aris = 50;
for (int i = 0; i < count; i++)
{
//create the radio button
RadioButton radio = new RadioButton();
radio.Name = i.ToString();
radio.Text = _mappings[i].Text;
radio.AutoSize = true;
//put radio button into the panel
panel1.Controls.Add(radio);
radio.Location = new Point(x_aris, y_aris + height);
height += radio.Height;
//Add click event to radio button
radio.Click += new EventHandler(radio_Click);
}
}