private void LoadSeat(string strID) { JobManage jobManage = new JobManage(); DataTable dtSeat = jobManage.GetAll2DefaultSeat(strID); foreach (DataRow drSeat in dtSeat.Rows) { ShowSeat seat = new ShowSeat(drSeat); if (seat.cnvcControlName.StartsWith("lbl")) { zhhLabel lbl = new zhhLabel(); lbl.Name = seat.cnvcControlName; lbl.Text = seat.cnvcSeat; Point p1 = new Point(seat.cnnX, seat.cnnY); lbl.Location = p1; lbl.Height = seat.cnnHeight; lbl.Width = seat.cnnWidth; lbl.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134))); lbl.TextAlign = ContentAlignment.MiddleCenter; lbl.BorderStyle = BorderStyle.None; switch (seat.cnvcDirection) { case "上": lbl.BorderBottom = System.Drawing.Color.Black; lbl.BorderLeft = System.Drawing.Color.Black; lbl.BorderRight = System.Drawing.Color.Black; lbl.BorderTop = System.Drawing.Color.Transparent; break; case "下": lbl.BorderBottom = System.Drawing.Color.Transparent; lbl.BorderLeft = System.Drawing.Color.Black; lbl.BorderRight = System.Drawing.Color.Black; lbl.BorderTop = System.Drawing.Color.Black; break; case "左": lbl.BorderBottom = System.Drawing.Color.Black; lbl.BorderLeft = System.Drawing.Color.Transparent; lbl.BorderRight = System.Drawing.Color.Black; lbl.BorderTop = System.Drawing.Color.Black; break; case "右": lbl.BorderBottom = System.Drawing.Color.Black; lbl.BorderLeft = System.Drawing.Color.Black; lbl.BorderRight = System.Drawing.Color.Transparent; lbl.BorderTop = System.Drawing.Color.Black; break; default: lbl.BorderBottom = System.Drawing.Color.Black; lbl.BorderLeft = System.Drawing.Color.Black; lbl.BorderRight = System.Drawing.Color.Black; lbl.BorderTop = System.Drawing.Color.Transparent; break; } lbl.AllowDrop = true; this.panel1.Controls.Add(lbl); } else { Label lbl2 = new Label(); lbl2.Name = seat.cnvcControlName; lbl2.BorderStyle = BorderStyle.FixedSingle; if (seat.cnvcControlName == "dlblEntry") { lbl2.Text = "入口|服务台"; } if (seat.cnvcControlName == "dlblPrint") { lbl2.Text = "文印室|电子显示屏"; } if (seat.cnvcControlName == "dlblSpace1") { } if (seat.cnvcControlName == "dlblSpace2") { } if (seat.cnvcControlName == "dlblStair") { lbl2.Text = "信息处理室|楼梯间"; } if (seat.cnvcControlName == "dlblToilet") { lbl2.Text = "卫生间"; } if (seat.cnvcControlName == "label1") { lbl2.Text = "洗手间"; } if (seat.cnvcControlName == "label2") { lbl2.Text = "出口"; } if (seat.cnvcControlName == "label13") { lbl2.BackColor = Color.Black; } if (seat.cnvcControlName == "label14") { lbl2.BackColor = Color.Black; } if (seat.cnvcControlName == "label15") { lbl2.BackColor = Color.Black; } if (seat.cnvcControlName == "label16") { lbl2.BackColor = Color.Black; } if (seat.cnvcControlName == "label17") { lbl2.BackColor = Color.Black; } Point p2 = new Point(seat.cnnX, seat.cnnY); lbl2.Location = p2; // lbl2.Left = seat.cnnX; // lbl2.Top = seat.cnnY; lbl2.Height = seat.cnnHeight; lbl2.Width = seat.cnnWidth; this.panel1.Controls.Add(lbl2); } } initProperty(); }