public PageViewHistory() { InitializeComponent(); timeSetting = new FormTimeSetting(); this.ForeColor = Color.Black; sf = new StringFormat(); sf.Alignment = StringAlignment.Center; sf.LineAlignment = StringAlignment.Center; chartFont = new Font("微软雅黑", 9F, FontStyle.Regular); currentFont = new Font("微软雅黑", 14F, FontStyle.Regular); buttonImage = new ImagesContaner(); buttonImage.DNImg = AdvaMACSystemRes.Dgn_down; buttonImage.UPImg = AdvaMACSystemRes.Dgn_up; buttonImage.UPImgDisaable = buttonImage.DNImgDisable = AdvaMACSystemRes.Dgn_disable; ibBack = new ImageButton(); ibBack.Size = new Size(ButtonWidth, ButtonHeight); ibBack.Location = new Point(800, 600); ibBack.IMGContainer = buttonImage; ibBack.Font = currentFont; ibBack.Text = "返回"; ibBack.Click += new EventHandler(ibBack_Click); this.Controls.Add(ibBack); cylinderList = new List <ImageButton>(); for (int i = 0; i < 8; i++) { ImageButton cylinder = new ImageButton(); cylinderList.Add(cylinder); cylinder.Size = new Size(CylinderWidth, CylinderHeight); cylinder.Location = new Point(CylinderMarginLeft, CylinderMarginTop + i * (CylinderHeight + CylinderSpacingY)); cylinder.IMGContainer = buttonImage; cylinder.Font = currentFont; cylinder.ForeColor = textColor; cylinder.Tag = i; cylinder.Text = (i + 1).ToString() + "#油缸"; cylinder.Toggle = true; cylinder.Click += new EventHandler(cylinder_Click); this.Controls.Add(cylinder); } dateImage = new SimpleImagesContaner(); dateImage.BackImg = dateImage.CheckedBackImg = dateImage.ImgDisable = AdvaMACSystemRes.Dgn_disable; inputImage = new SimpleImagesContaner(); inputImage.BackImg = inputImage.CheckedBackImg = inputImage.ImgDisable = AdvaMACSystemRes.Input40x40; imageLabel_title = new ComCtrls.ImageLabel(); pBox = new PictureBox(); pbDataTable = new PictureBox(); lbPumpName = new Label(); ilDate = new ImageLabel(); ibPrevDay = new ImageButton(); ibNextDay = new ImageButton(); ilPumpIndex = new ImageLabel(); ilCurrentPage = new ImageLabel(); lbPage = new Label(); prevPage = new ImageButton(); nextPage = new ImageButton(); this.SuspendLayout(); prevPage.Size = new Size(40, 40); prevPage.Location = new Point(BmpLeft, 562); prevPage.Font = currentFont; prevPage.UPImg = prevPage.UPImgDisable = AdvaMACSystemRes.leftup; prevPage.DNImg = prevPage.DNImgDisable = AdvaMACSystemRes.leftdown; prevPage.Click += new EventHandler(prevPage_Click); this.Controls.Add(prevPage); nextPage.Size = new Size(40, 40); nextPage.Location = new Point(BmpLeft + 350, 562); nextPage.Font = currentFont; nextPage.UPImg = nextPage.UPImgDisable = AdvaMACSystemRes.rightup; nextPage.DNImg = nextPage.DNImgDisable = AdvaMACSystemRes.rightdown; nextPage.Click += new EventHandler(nextPage_Click); this.Controls.Add(nextPage); ibPrevDay.Size = new Size(100, 40); ibPrevDay.Location = new Point(CylinderMarginLeft, CylinderMarginTop + 9 * (CylinderHeight + CylinderSpacingY)); ibPrevDay.Font = currentFont; ibPrevDay.Text = "前一天"; ibPrevDay.UPImg = ibPrevDay.UPImgDisable = AdvaMACSystemRes.half_disable; ibPrevDay.DNImg = ibPrevDay.DNImgDisable = AdvaMACSystemRes.half_disable; ibPrevDay.Click += new EventHandler(ibPrevDay_Click); this.Controls.Add(ibPrevDay); ibNextDay.Size = new Size(100, 40); ibNextDay.Location = new Point(CylinderMarginLeft + 110, CylinderMarginTop + 9 * (CylinderHeight + CylinderSpacingY)); ibNextDay.Font = currentFont; ibNextDay.Text = "后一天"; ibNextDay.UPImg = ibNextDay.UPImgDisable = AdvaMACSystemRes.half_disable; ibNextDay.DNImg = ibNextDay.DNImgDisable = AdvaMACSystemRes.half_disable; ibNextDay.Click += new EventHandler(ibNextDay_Click); this.Controls.Add(ibNextDay); this.imageLabel_title.BackColor = System.Drawing.Color.Silver; this.imageLabel_title.Checked = false; this.imageLabel_title.Dock = System.Windows.Forms.DockStyle.Top; this.imageLabel_title.Font = new System.Drawing.Font("Arial", 20F, System.Drawing.FontStyle.Bold); this.imageLabel_title.Location = new System.Drawing.Point(0, 0); this.imageLabel_title.Name = "imageLabel_title"; this.imageLabel_title.Size = new System.Drawing.Size(1024, 57); this.imageLabel_title.TabIndex = 0; this.imageLabel_title.Text = "历史记录"; this.imageLabel_title.TransParent = false; this.Controls.Add(this.imageLabel_title); pBox.Size = new Size(BmpWidth, BmpHeight); pBox.Location = new Point(BmpLeft, BmpTop); pBox.Visible = true; this.Controls.Add(pBox); pbDataTable.Size = new Size(CellWidth * Columns + 1, CellHeight * Lines + 1); pbDataTable.Location = new Point(BmpLeft, TableMarginTop); pbDataTable.Visible = true; this.Controls.Add(pbDataTable); lbPumpName.Size = new Size(100, 40); lbPumpName.Location = new Point(CylinderMarginLeft + 100, CylinderMarginTop - CylinderHeight - CylinderSpacingY + 10); lbPumpName.Font = currentFont; lbPumpName.Text = "号泵站"; this.Controls.Add(lbPumpName); ilDate.Size = new Size(CylinderWidth, CylinderHeight); ilDate.Location = new Point(CylinderMarginLeft, CylinderMarginTop + 8 * (CylinderHeight + CylinderSpacingY)); ilDate.Font = currentFont; ilDate.IMGContainer = dateImage; ilDate.Click += new EventHandler(ilDate_Click); this.Controls.Add(ilDate); ilCurrentPage.Size = new Size(80, 40); ilCurrentPage.Location = new Point(BmpLeft + 70, 562); ilCurrentPage.Font = currentFont; ilCurrentPage.BackImg = AdvaMACSystemRes.Input80x40; ilCurrentPage.Click += new EventHandler(ilCurrentPage_Click); this.Controls.Add(ilCurrentPage); ilPumpIndex.Size = new Size(40, 40); ilPumpIndex.Font = currentFont; ilPumpIndex.IMGContainer = inputImage; ilPumpIndex.Location = new Point(CylinderMarginLeft + 50, CylinderMarginTop - CylinderHeight - CylinderSpacingY); ilPumpIndex.Click += new EventHandler(ilPumpIndex_Click); this.Controls.Add(ilPumpIndex); lbPage.Size = new Size(300, 40); lbPage.Location = new Point(BmpLeft + 45, 572); lbPage.Font = currentFont; this.Controls.Add(lbPage); this.ResumeLayout(false); }
private void CreateInputBox(int subid, Point topleft, bool istotal, bool isRow) { int in_Space = 5; ComCtrls.ImageLabel btn_input; Label lb_first, lb1_tail; // // label 层 第 // lb_first = new System.Windows.Forms.Label(); lb_first.Font = new System.Drawing.Font("Tahoma", 15F, System.Drawing.FontStyle.Regular); lb_first.Location = topleft; lb_first.Size = new System.Drawing.Size(30, 23); lb_first.Text = (istotal) ? "共" : "第"; lb_first.ForeColor = System.Drawing.Color.Black; // // btn_input // btn_input = new ComCtrls.ImageLabel(); btn_input.BackColor = System.Drawing.Color.White; btn_input.Checked = false; btn_input.Font = new System.Drawing.Font("Arial", 15F, System.Drawing.FontStyle.Regular); btn_input.Layout = ComCtrls.KTLayout.GlyphTop; btn_input.Location = new System.Drawing.Point(topleft.X + lb_first.Width + in_Space, topleft.Y); btn_input.Name = "btn_input"; btn_input.Size = new System.Drawing.Size(103, 29); btn_input.TabIndex = 3; btn_input.Tag = subid; btn_input.Text = "0"; btn_input.TextX = -1F; btn_input.TextY = -1F; btn_input.TransParent = false; if (istotal) { if (isRow) { btn_input.Click += new System.EventHandler(imageLabel_Input_total_Row_Click); btnlst_subid_Row_Count = btn_input; } else { btn_input.Click += new System.EventHandler(imageLabel_Input_total_Col_Click); btnlst_subid_Col_Count = btn_input; } } else { if (isRow) { btn_input.Click += new System.EventHandler(imageLabel_Input_Row_Click); } else { btn_input.Click += new System.EventHandler(imageLabel_Input_Col_Click); } } if (!istotal) { if (isRow) { btnlst_subid_Row.Add(btn_input); } else { btnlst_subid_Col.Add(btn_input); } } // // label 层 尾 // lb1_tail = new System.Windows.Forms.Label(); lb1_tail.Font = new System.Drawing.Font("Tahoma", 15F, System.Drawing.FontStyle.Regular); lb1_tail.Location = new Point(topleft.X + lb_first.Width + btn_input.Width + in_Space, topleft.Y); lb1_tail.Size = new System.Drawing.Size(30, 23); lb1_tail.Text = (isRow) ? "层" : "支"; lb1_tail.ForeColor = System.Drawing.Color.Black; this.Controls.Add(btn_input); this.Controls.Add(lb_first); this.Controls.Add(lb1_tail); this.panel_body.Controls.Add(btn_input); this.panel_body.Controls.Add(lb_first); this.panel_body.Controls.Add(lb1_tail); }