标签:vat nta temp lsb i++ The span set config
private void InitAddAdcLsb() { ucCount = ConfigFile.GeAdcLsbCount(); int horizontalSpace = 1; int verticalSpace = 1; if(ucCount > 11) { ucCount = 11; } if (ucCount < 0) { ucCount = 1; } if (ucCount >= 1) { this.panelAllAdcLsb.Controls.Add(uc1); } int locW = uc1.Width; int locH = uc1.Height; int locX = uc1.Location.X; int locY = uc1.Location.Y; List<Point> ucLocList = new List<Point>(); Point pt11 = new Point(locX, locY); Point pt12= new Point(locX + locW + horizontalSpace, locY); Point pt13 = new Point(locX + 2 * locW + horizontalSpace, locY); locY += locH + verticalSpace; Point pt21 = new Point(locX, locY); Point pt22 = new Point(locX + locW + horizontalSpace, locY); Point pt23 = new Point(locX + 2 * locW + horizontalSpace, locY); Point pt24 = new Point(locX + 3 * locW + horizontalSpace, locY); locY += locH + verticalSpace; Point pt31 = new Point(locX, locY); Point pt32 = new Point(locX + locW + horizontalSpace, locY); Point pt33 = new Point(locX + 2 * locW + horizontalSpace, locY); Point pt34 = new Point(locX + 3 * locW + horizontalSpace, locY); ucLocList.Add(pt11); ucLocList.Add(pt12); ucLocList.Add(pt13); ucLocList.Add(pt21); ucLocList.Add(pt22); ucLocList.Add(pt23); ucLocList.Add(pt24); ucLocList.Add(pt31); ucLocList.Add(pt32); ucLocList.Add(pt33); ucLocList.Add(pt34); ucList[1].Location = new Point(ucLocList[3].X, ucLocList[3].Y);//uc 2 this.panelAllAdcLsb.Controls.Add(ucList[1]); ucList[2].Location = new Point(ucLocList[1].X, ucLocList[1].Y);//3 this.panelAllAdcLsb.Controls.Add(ucList[2]); ucList[3].Location = new Point(ucLocList[4].X, ucLocList[4].Y);//4 this.panelAllAdcLsb.Controls.Add(ucList[3]); ucList[4].Location = new Point(ucLocList[2].X, ucLocList[2].Y);//5 this.panelAllAdcLsb.Controls.Add(ucList[4]); ucList[5].Location = new Point(ucLocList[5].X, ucLocList[5].Y);//6 this.panelAllAdcLsb.Controls.Add(ucList[5]); for (int i=6;i<ucCount;i++) { ucList[i].Location = new Point(ucLocList[i].X, ucLocList[i].Y); this.panelAllAdcLsb.Controls.Add(ucList[i]); } uc1.SetTxtSNFocus(); //if (ucCount >= 1) //{ // this.panelAllAdcLsb.Controls.Add(uc1); //} //int locW = uc1.Width; //int locH = uc1.Height; //int locX = uc1.Location.X; //int locY = uc1.Location.Y; /* if (ucCount >= 2) { uc2.Location = new Point(locX + locW + horizontalSpace, locY); this.panelAllAdcLsb.Controls.Add(uc2); } if (ucCount >= 3) { uc3.Location = new Point(locX + 2*locW + horizontalSpace, locY); this.panelAllAdcLsb.Controls.Add(uc3); } //the second row locY += locH + verticalSpace; if (ucCount >= 4) { uc4.Location = new Point(locX, locY); this.panelAllAdcLsb.Controls.Add(uc4); } if (ucCount >= 5) { uc5.Location = new Point(locX + locW + horizontalSpace, locY); this.panelAllAdcLsb.Controls.Add(uc5); } if (ucCount >= 6) { uc6.Location = new Point(locX + 2*locW + horizontalSpace, locY); this.panelAllAdcLsb.Controls.Add(uc6); } if (ucCount >= 7) { uc7.Location = new Point(locX + 3 * locW + horizontalSpace, locY); this.panelAllAdcLsb.Controls.Add(uc7); } //the third row locY += locH + verticalSpace; if (ucCount >= 8) { uc8.Location = new Point(locX, locY); this.panelAllAdcLsb.Controls.Add(uc8); } if (ucCount >= 9) { uc9.Location = new Point(locX + locW + horizontalSpace, locY); this.panelAllAdcLsb.Controls.Add(uc9); } if (ucCount >= 10) { uc10.Location = new Point(locX + 2*locW + horizontalSpace, locY); this.panelAllAdcLsb.Controls.Add(uc10); } if (ucCount >= 11) { uc11.Location = new Point(locX + 3 * locW + horizontalSpace, locY); this.panelAllAdcLsb.Controls.Add(uc11); } uc1.SetTxtSNFocus(); */ }
标签:vat nta temp lsb i++ The span set config
原文地址:https://www.cnblogs.com/ike_li/p/11944127.html