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;
}