private void initCompoment() { int gapLine = 20, gapX = 20, gapY = 20; Size size = new Size(); int scrW = Screen.PrimaryScreen.Bounds.Width; pnTop = new Panel(); pnTop.Dock = DockStyle.Fill; lbTxtFilename = new Label(); bc.setControlLabel(ref lbTxtFilename, fEdit, "File Name", "lbTxtFilename", gapX, gapY); txtFilename = new C1TextBox(); bc.setControlC1TextBox(ref txtFilename, fEdit, "txtFilename", 250, lbTxtFilename.Location.X + lbTxtFilename.Width, gapY); gapLine += 40; btnGenPdf = new C1Button(); btnGenPdf.Name = "btnGenPdf"; btnGenPdf.Text = "Save"; btnGenPdf.Font = fEdit; //size = bc.MeasureString(btnHnSearch); btnGenPdf.Location = new System.Drawing.Point(gapX, gapLine); btnGenPdf.Size = new Size(200, 140); btnGenPdf.Font = fEdit; btnGenPdf.Image = Resources.Save_small; btnGenPdf.TextAlign = ContentAlignment.MiddleRight; btnGenPdf.ImageAlign = ContentAlignment.MiddleLeft; btnGenPdf.Click += BtnGenPdf_Click; pnTop.Controls.Add(lbTxtFilename); pnTop.Controls.Add(txtFilename); this.Controls.Add(pnTop); }
private void initCompoment() { int gapLine = 25, gapX = 20, gapY = 20, xCol2 = 130, xCol1 = 80, xCol3 = 330, xCol4 = 640, xCol5 = 950; Size size = new Size(); tcMain = new C1DockingTab(); tcMain.Dock = System.Windows.Forms.DockStyle.Fill; tcMain.Location = new System.Drawing.Point(0, 266); tcMain.Name = "tcMain"; tcMain.Size = new System.Drawing.Size(669, 200); tcMain.TabIndex = 0; tcMain.TabsSpacing = 5; tabImportDf = new C1DockingTabPage(); tabImportDf.Dock = System.Windows.Forms.DockStyle.Fill; tabImportDf.Name = "tabImportDf"; tabImportDf.Text = "Import Item DF"; grfSelect = new C1FlexGrid(); grfSelect.Font = fEdit; grfSelect.Dock = System.Windows.Forms.DockStyle.Bottom; grfSelect.Location = new System.Drawing.Point(0, 0); grfSelect.Rows.Count = 1; lbDateStart = new Label(); txtDateStart = new C1DateEdit(); btnDeleteAll = new C1Button(); cboDocGrp = new C1ComboBox(); txtPaidType = new C1TextBox(); lbHn = new Label(); txtHn = new C1TextBox(); btnPrint = new C1Button(); btnGet = new C1Button(); bc.setControlLabel(ref lbDateStart, fEdit, "วันที่เริ่มต้น :", "lbDateStart", gapX, gapY); size = bc.MeasureString(lbDateStart); bc.setControlC1DateTimeEdit(ref txtDateStart, "txtDateStart", lbDateStart.Location.X + size.Width + 5, gapY); bc.setControlC1ComboBox(ref cboDocGrp, "cboDocGrp", 80, txtDateStart.Location.X + txtDateStart.Width + 25, gapY); cboDocGrp.Font = fEdit; ComboBoxItem item = new ComboBoxItem(); item = new ComboBoxItem(); item.Value = "1"; item.Text = "รอบ 1"; cboDocGrp.Items.Add(item); item = new ComboBoxItem(); item.Value = "2"; item.Text = "รอบ 2"; cboDocGrp.Items.Add(item); item = new ComboBoxItem(); item.Value = "3"; item.Text = "รอบ 3"; cboDocGrp.Items.Add(item); //item = new ComboBoxItem(); //item.Value = "3"; //item.Text = "รอบ 3"; //cboDocGrp.Items.Add(item); bc.setControlC1TextBox(ref txtPaidType, fEdit, "txtPaidType", 140, cboDocGrp.Location.X + cboDocGrp.Width + 25, gapY); bc.setControlLabel(ref lbHn, fEdit, "search :", "lbHn", txtPaidType.Location.X + txtPaidType.Width + 55, gapY); size = bc.MeasureString(lbHn); bc.setControlC1TextBox(ref txtHn, fEdit, "txtHn", 140, lbHn.Location.X + lbHn.Width + 10, gapY); bc.setControlC1Button(ref btnDeleteAll, fEdit, "Clear Data", "btnDeleteAll", txtHn.Location.X + txtHn.Width + 20, gapY); btnDeleteAll.Width = 120; btnDeleteAll.Height = btnDeleteAll.Height + 10; bc.setControlC1Button(ref btnPrint, fEdit, "Print", "btnPrint", btnDeleteAll.Location.X + btnDeleteAll.Width + 60, gapY); btnPrint.Width = 140; btnPrint.Height = btnPrint.Height + 10; bc.setControlC1Button(ref btnGet, fEdit, "get", "btnGet", btnPrint.Location.X + btnPrint.Width + 60, gapY); btnGet.Width = 140; btnGet.Height = btnGet.Height + 10; tabImportDf.Controls.Add(grfSelect); theme1.SetTheme(grfSelect, "Office2010Red"); tabImportDf.Controls.Add(lbDateStart); tabImportDf.Controls.Add(txtDateStart); tabImportDf.Controls.Add(cboDocGrp); tabImportDf.Controls.Add(btnDeleteAll); tabImportDf.Controls.Add(btnPrint); tabImportDf.Controls.Add(txtPaidType); tabImportDf.Controls.Add(lbHn); tabImportDf.Controls.Add(txtHn); tabImportDf.Controls.Add(btnGet); tcMain.Controls.Add(tabImportDf); this.Controls.Add(tcMain); }
private void initCompoment() { int gapLine = 25, gapX = 20, gapY = 20, xCol2 = 130, xCol1 = 80, xCol3 = 330, xCol4 = 640, xCol5 = 950; Size size = new Size(); tcMain = new C1DockingTab(); tcMain.Dock = System.Windows.Forms.DockStyle.Fill; tcMain.Location = new System.Drawing.Point(0, 266); tcMain.Name = "tcMain"; tcMain.Size = new System.Drawing.Size(669, 200); tcMain.TabIndex = 0; tcMain.TabsSpacing = 5; tabImportDf = new C1DockingTabPage(); tabImportDf.Dock = System.Windows.Forms.DockStyle.Fill; tabImportDf.Name = "tabImportDf"; tabImportDf.Text = "Import Item DF"; grfSelect = new C1FlexGrid(); grfSelect.Font = fEdit; grfSelect.Dock = System.Windows.Forms.DockStyle.Bottom; grfSelect.Location = new System.Drawing.Point(0, 0); grfSelect.Rows.Count = 1; lbDateStart = new Label(); txtDateStart = new C1DateEdit(); lbDateEnd = new Label(); txtDateEnd = new C1DateEdit(); lbtxtPaidType = new Label(); txtPaidType = new C1TextBox(); btnImportDfSelect = new C1Button(); btnImportDfGen = new C1Button(); lbLoading = new Label(); lbLoading.Font = fEdit5B; lbLoading.BackColor = Color.WhiteSmoke; lbLoading.ForeColor = Color.Black; lbLoading.AutoSize = false; lbLoading.Size = new Size(300, 60); bc.setControlLabel(ref lbDateStart, fEdit, "วันที่เริ่มต้น :", "lbDateStart", gapX, gapY); size = bc.MeasureString(lbDateStart); bc.setControlC1DateTimeEdit(ref txtDateStart, "txtDateStart", lbDateStart.Location.X + size.Width + 5, gapY); size = bc.MeasureString(lbDateStart); //bc.setControlC1DateTimeEdit(ref txtDateStart, "txtDateStart", lbDateStart.Location.X + size.Width + 5, gapY); bc.setControlLabel(ref lbDateEnd, fEdit, "วันที่สิ้นสุด :", "lbDateEnd", txtDateStart.Location.X + txtDateStart.Width + 15, gapY); size = bc.MeasureString(lbDateEnd); bc.setControlC1DateTimeEdit(ref txtDateEnd, "txtDateEnd", lbDateEnd.Location.X + size.Width + 5, gapY); bc.setControlLabel(ref lbtxtPaidType, fEdit, "สิทธิ (xx,...) :", "lbtxtPaidType", txtDateEnd.Location.X + txtDateEnd.Width + 15, gapY); size = bc.MeasureString(lbtxtPaidType); bc.setControlC1TextBox(ref txtPaidType, fEdit, "txtPaidType", 120, lbtxtPaidType.Location.X + size.Width + 5, gapY); bc.setControlC1Button(ref btnImportDfSelect, fEdit, "ดึงข้อมูล", "btnSelect", txtPaidType.Location.X + txtPaidType.Width + 20, gapY); btnImportDfSelect.Width = 70; bc.setControlC1Button(ref btnImportDfGen, fEdit, "gen Text", "btnGen", btnImportDfSelect.Location.X + btnImportDfSelect.Width + 20, gapY); btnImportDfGen.Width = 80; tabImportDf.Controls.Add(grfSelect); theme1.SetTheme(grfSelect, "Office2010Red"); tabImportDf.Controls.Add(lbDateStart); tabImportDf.Controls.Add(txtDateStart); tabImportDf.Controls.Add(lbDateEnd); tabImportDf.Controls.Add(txtDateEnd); tabImportDf.Controls.Add(lbtxtPaidType); tabImportDf.Controls.Add(txtPaidType); tabImportDf.Controls.Add(btnImportDfSelect); tabImportDf.Controls.Add(btnImportDfGen); tcMain.Controls.Add(tabImportDf); this.Controls.Add(lbLoading); this.Controls.Add(tcMain); }
private void setForm() { frm = new Form(); int gapLine = 25, gapX = 20, gapY = 20, xCol2 = 130, xCol1 = 80, xCol3 = 470, xCol4 = 640, xCol5 = 950; Size size = new Size(); //throw new NotImplementedException(); frm.Size = new Size(1100, 800); frm.StartPosition = FormStartPosition.CenterScreen; pn.Dock = DockStyle.Fill; frm.Controls.Add(pn); grfImg = new C1FlexGrid(); grfImg.Font = fEdit; grfImg.Dock = System.Windows.Forms.DockStyle.Bottom; grfImg.Location = new System.Drawing.Point(0, 0); grfImg.Rows.Count = 1; grfImg.Height = 540; grfImg.Rows.Count = 6; grfImg.Cols.Count = 15; grfImg.Cols[1].Caption = ""; //grfINS.Cols[2].Caption = "เลขที่เอกสาร"; //grfDITdc02.Cols[3].Caption = "Vendor"; //grfDITdc02.Cols[4].Caption = "Price New"; grfImg.Cols[1].Width = 120; grfImg.Cols[2].Width = 150; pn.Controls.Add(grfImg); lbID = new Label(); lbPID = new Label(); lbName = new Label(); lbDate = new Label(); lbAddress = new Label(); lbEmail = new Label(); lbMobile = new Label(); lbDose = new Label(); txtID = new C1TextBox(); txtPID = new C1TextBox(); txtName = new C1TextBox(); txtDate = new C1TextBox(); txtAddress = new C1TextBox(); txtEmail = new C1TextBox(); txtMobile = new C1TextBox(); txtDose = new C1TextBox(); bc.setControlLabel(ref lbID, fEdit, "เลขที่ใบจอง :", "lbID", gapX, gapY); size = bc.MeasureString(lbID); bc.setControlC1TextBox(ref txtID, fEdit, "txtID", 120, xCol2, lbID.Location.Y); txtID.Width = 120; bc.setControlLabel(ref lbPID, fEdit, "PID :", "lbPID", xCol3, lbID.Location.Y); size = bc.MeasureString(lbPID); bc.setControlC1TextBox(ref txtPID, fEdit, "txtPID", 120, lbPID.Location.X + size.Width + 15, lbID.Location.Y); txtPID.Width = 160; gapY += gapLine; bc.setControlLabel(ref lbName, fEdit, "ชื่อ นามสกุล :", "lbName", gapX, gapY); size = bc.MeasureString(lbName); bc.setControlC1TextBox(ref txtName, fEdit, "txtName", 120, xCol2, lbName.Location.Y); txtName.Width = 320; gapY += gapLine; bc.setControlLabel(ref lbDate, fEdit, "วันที่จอง :", "lbDate", gapX, gapY); size = bc.MeasureString(lbDate); bc.setControlC1TextBox(ref txtDate, fEdit, "txtDate", 120, xCol2, lbDate.Location.Y); txtDate.Width = 180; gapY += gapLine; bc.setControlLabel(ref lbAddress, fEdit, "ที่อยู่ :", "lbAddress", gapX, gapY); size = bc.MeasureString(lbDate); bc.setControlC1TextBox(ref txtAddress, fEdit, "txtAddress", 120, xCol2, lbAddress.Location.Y); txtAddress.Width = 620; gapY += gapLine; bc.setControlLabel(ref lbEmail, fEdit, "Email :", "lbEmail", gapX, gapY); size = bc.MeasureString(lbDate); bc.setControlC1TextBox(ref txtEmail, fEdit, "txtEmail", 120, xCol2, lbEmail.Location.Y); txtEmail.Width = 320; bc.setControlLabel(ref lbMobile, fEdit, "Mobile :", "lbMobile", xCol3, lbEmail.Location.Y); size = bc.MeasureString(lbPID); bc.setControlC1TextBox(ref txtMobile, fEdit, "txtMobile", 120, lbMobile.Location.X + size.Width + 15, lbMobile.Location.Y); txtMobile.Width = 200; gapY += gapLine; bc.setControlLabel(ref lbDose, fEdit, "Dose :", "lbDose", gapX, gapY); size = bc.MeasureString(lbDate); bc.setControlC1TextBox(ref txtDose, fEdit5B, "txtDose", 120, xCol2, lbDose.Location.Y); txtDose.Width = 300; gapY += gapLine + 40; bc.setControlC1Button(ref btnApprove, fEdit, "ตรวจสอบเรียบร้อย", "btnApprove", gapX, gapY); btnApprove.Width = 180; bc.setControlC1Button(ref btnPrn, fEdit, "พิมพ์ ใบจอง", "btnPrn", btnApprove.Location.X + btnApprove.Width + 40, gapY); btnPrn.Width = 120; gapY += gapLine + 40; bc.setControlC1Button(ref btnUnApprove, fEdit, "ตรวจสอบ ยังไม่เรียบร้อย", "btnUnApprove", gapX, gapY); btnUnApprove.Width = 180; c1BarCode1 = new C1.Win.BarCode.C1BarCode(); c1BarCode1.AdditionalNumber = null; c1BarCode1.BackColor = System.Drawing.Color.White; c1BarCode1.CodeType = C1.BarCode.CodeType.QRCode; c1BarCode1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F); c1BarCode1.ForeColor = System.Drawing.Color.Black; c1BarCode1.Location = new System.Drawing.Point(800, 60); c1BarCode1.MicroQRCodeOptions.EncodingCodePage = 65001; c1BarCode1.Name = "c1BarCode1"; c1BarCode1.QuietZone.Bottom = 0D; c1BarCode1.QuietZone.Left = 0D; c1BarCode1.QuietZone.Right = 0D; c1BarCode1.QuietZone.Top = 0D; c1BarCode1.Size = new System.Drawing.Size(151, 150); c1BarCode1.TabIndex = 1; c1BarCode1.Text = txtID.Text; c1BarCode1.TextFixedLength = 0; c1BarCode1.WideToNarrowRatio = 2F; ContextMenu menuGw = new ContextMenu(); menuGw.MenuItems.Add("ตรวจสอบเรียบร้อย", new EventHandler(ContextMenu_Approve)); menuGw.MenuItems.Add("พิมพ์ ใบจอง", new EventHandler(ContextMenu_printReservel)); menuGw.MenuItems.Add("ตรวจสอบ ยังไม่เรียบร้อย", new EventHandler(ContextMenu_UnApprove)); frm.ContextMenu = menuGw; pn.Controls.Add(txtID); pn.Controls.Add(txtPID); pn.Controls.Add(lbID); pn.Controls.Add(lbPID); pn.Controls.Add(txtName); pn.Controls.Add(lbName); pn.Controls.Add(txtDate); pn.Controls.Add(lbDate); pn.Controls.Add(txtAddress); pn.Controls.Add(lbAddress); pn.Controls.Add(txtMobile); pn.Controls.Add(lbMobile); pn.Controls.Add(txtEmail); pn.Controls.Add(lbEmail); pn.Controls.Add(txtDose); pn.Controls.Add(lbDose); pn.Controls.Add(c1BarCode1); }