private void SetButtonLocation( int beforemoveLoacation,int afterMoveLoacation,ArrayList buttonList)
{
if(beforemoveLoacation>afterMoveLoacation)//向前移动
{
for(int i=beforemoveLoacation;i>afterMoveLoacation;i--)
buttonList[i-1].Location=buttonList[i].Location;
}
if(beforemoveLoacation<afterMoveLoacation)//向后移动
{
for(int i=beforemoveLoacation;i<afterMoveLoacation;i++)
buttonList[i+1].Location=buttonList[i].Location;
}
buttonList[beforemoveLoacation].Location=buttonList[afterMoveLoacation].Location;
}
{
if(beforemoveLoacation>afterMoveLoacation)//向前移动
{
for(int i=beforemoveLoacation;i>afterMoveLoacation;i--)
buttonList[i-1].Location=buttonList[i].Location;
}
if(beforemoveLoacation<afterMoveLoacation)//向后移动
{
for(int i=beforemoveLoacation;i<afterMoveLoacation;i++)
buttonList[i+1].Location=buttonList[i].Location;
}
buttonList[beforemoveLoacation].Location=buttonList[afterMoveLoacation].Location;
}
解决方案 »
- 用代码从后台直接生成的控件,如何赋予事件?
- jQuery
- 怎么得到当前执行程序的句柄啊
- C#如何直接通过datagrid修改数据库数据
- 新手问题:一个项目的子文件夹如何再添加一个现有的项目
- 求问怎么下载地址加上随机数字串的验证码
- ####*****CSDN,有多少个高手,机会来了!!!有贴过高手没出现,只见一个同路人!!,,********C#.web与SQL SERVER 联接的问题,,,,
- FORM窗体中能否设计表格?
- 看看他的效果是怎么做的!
- 使用WebBrowser控件时,如果自动填充其中的文本框,然后自动提交?
- 为什么在线程里运行的程序不能实例化别人窗口?
- 请问如何将“string”转换为“int”
{
button[i].left=button[i].left+button8.wide;
}
button8.left=button1.left+button1.wide;//祝你好运!