一个panel中动态生成一些radio和一个textbox。
初始化的时候动态给radio加事件 使得切换radio时一当某个radio被选中,下面的textbox立刻显示该radio的text值
do u understand what i mean..........
初始化的时候动态给radio加事件 使得切换radio时一当某个radio被选中,下面的textbox立刻显示该radio的text值
do u understand what i mean..........
调试欢乐多
{
throw new Exception("The method or operation is not implemented.");
}
int width = 6;
int hang = 1;
CheckBox ckb=null;
foreach (string item in strList)
{
if (width > 308)
{
hang += 10;
width = 6;
}
ckb = new CheckBox();
ckb.Text =item;
ckb.Location = new System.Drawing.Point(width, 2 * hang);
ckb.CheckedChanged += new EventHandler(ckb_CheckedChanged);
x = ckb.Text.Length;
ckb.Size = new System.Drawing.Size(x * 13 + 18, 16);
width = ckb.Location.X + ckb.Size.Width + 10;
pnlChildBox.Controls.Add(ckb); } void ckb_CheckedChanged(object sender, EventArgs e)
{
CheckBox rbt= (CheckBox )sender;
textbox=rbt.text;
}这是动态创建CheckBox 的,,楼主稍微改下就可以了。