我动态创建多个checkbox 规定好一行显示的个数,但是在checkbox总的个数不确定下,我不知道怎样分行显示checkbox,请帮帮我,多谢啦!
解决方案 »
- 本人想用C#开发一个模拟DNF的加点器.请问有朋友能帮帮忙吗?
- txtLoginPwd.Attributes["uPwd"] = Cookie.Values["uPwd"];
- 求C#多线程,异步方面的资料
- 请教:为某个控件选择背景图片时,如何从ide 的资源文件对话框中列出多个项目资源选择?
- 帮我看看那里出错了!
- 大家好,问大家几个理论问题
- 求助:将word文档转换为html
- new 一个子类赋到父类
- cookie引用问题
- 怎样在DataView的RowFilter属性表达式中使用单个字符的通配符?
- 在一台不与外界连接的物理主机中,如何在虚拟机中安装一个Microsoft Loopback Adapter来与物理主机中的Microsoft Loopback Adapter组成一个单独的网络,以实现虚拟机访问物理主机的数据库。
- 求助
int chkheight = 20;
int noofeachline = 3;//没行个数
int noofcheck = 13;//总个数
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < noofcheck; i++)
{
CheckBox tmchk = new CheckBox();
tmchk.Text = "check" + i.ToString();
tmchk.Left = (i % noofeachline) * 80 + 5;
tmchk.Top = (int)(i / noofeachline) * 20 + 5;
tmchk.Width = chkwidth;
this.Controls.Add(tmchk);
}
}
int chkwidth = 80;//宽
int chkheight = 20;//高
int noofeachline = 3;//没行个数
int noofcheck = 13;//总个数
int tmint = 8;//行间距 和 列间距
private void button1_Click(object sender, EventArgs e)
{
for (int i = 0; i < noofcheck; i++)
{
CheckBox tmchk = new CheckBox();
tmchk.Text = "check" + i.ToString();
tmchk.Left = (i % noofeachline) * chkwidth + tmint;
tmchk.Top = (int)(i / noofeachline) * chkheight + tmint;
tmchk.Width = chkwidth;
tmchk.Height = chkheight;
this.Controls.Add(tmchk);
}
}