private void setControlComponent() { int gapLine = 10, gapX = 20; Size size = new Size(); int scrW = Screen.PrimaryScreen.Bounds.Width; btnCap1 = new C1Button(); btnCap1.Name = "btnCap1"; btnCap1.Text = "Capture 1"; btnCap1.Font = fEdit; //size = bc.MeasureString(btnHnSearch); btnCap1.Location = new System.Drawing.Point(gapX, 10); size = bc.MeasureString(btnCap1); btnCap1.Size = new Size(size.Width + 10, 30); btnCap1.Font = fEdit; }
private void setControlComponent() { //new LogWriter("d", "FrmDoctorView setControlComponent 00 "); int gapLine = 10, gapX = 20; Size size = new Size(); int scrW = Screen.PrimaryScreen.Bounds.Width; lbDtrName = new Label(); lbDtrName.Text = "..."; lbDtrName.Font = fEditBig; lbDtrName.Location = new System.Drawing.Point(gapX, 5); lbDtrName.AutoSize = true; lbDtrName.Name = "lbDtrName"; lbTxtPttHn = new Label(); lbTxtPttHn.Text = "HN :"; lbTxtPttHn.Font = fEditBig; size = bc.MeasureString(lbTxtPttHn); lbTxtPttHn.Location = new System.Drawing.Point(((scrW / 2) - size.Width) - 60, lbDtrName.Location.Y); lbTxtPttHn.AutoSize = true; lbTxtPttHn.Name = "lbTxtPttHn"; //lbDtrName.SuspendLayout(); //lbTxtPttHn.SuspendLayout(); txtPttHn = new C1TextBox(); txtPttHn.Font = fEditBig; txtPttHn.Location = new System.Drawing.Point(lbTxtPttHn.Location.X + size.Width + 5, lbTxtPttHn.Location.Y); txtPttHn.Size = new Size(120, 20); btnHnSearch = new C1Button(); btnHnSearch.Name = "btnHnSearch"; btnHnSearch.Text = "..."; btnHnSearch.Font = fEdit; //size = bc.MeasureString(btnHnSearch); btnHnSearch.Location = new System.Drawing.Point(txtPttHn.Location.X + txtPttHn.Width + 5, lbTxtPttHn.Location.Y); btnHnSearch.Size = new Size(30, lbTxtPttHn.Height); btnHnSearch.Font = fEdit; //lbPttName = new Label(); //lbPttName.Text = "..."; //lbPttName.Font = fEditBig; //lbPttName.Location = new System.Drawing.Point(btnHnSearch.Location.X + btnHnSearch.Width + 10, lbTxtPttHn.Location.Y); //lbPttName.AutoSize = true; //lbPttName.Name = "lbPttName"; txtDate = new C1DateEdit(); txtDate.AllowSpinLoop = false; txtDate.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; txtDate.Calendar.Font = new System.Drawing.Font("Tahoma", 8F); txtDate.Calendar.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue; txtDate.Calendar.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue; txtDate.CurrentTimeZone = false; txtDate.DisplayFormat.CustomFormat = "dd/MM/yyyy"; txtDate.DisplayFormat.FormatType = FormatTypeEnum.CustomFormat; txtDate.FormatType = C1.Win.C1Input.FormatTypeEnum.CustomFormat; txtDate.DisplayFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(((((C1.Win.C1Input.FormatInfoInheritFlags.NullText | C1.Win.C1Input.FormatInfoInheritFlags.EmptyAsNull) | C1.Win.C1Input.FormatInfoInheritFlags.TrimStart) | C1.Win.C1Input.FormatInfoInheritFlags.TrimEnd) | C1.Win.C1Input.FormatInfoInheritFlags.CalendarType))); txtDate.EditFormat.CustomFormat = "dd/MM/yyyy"; txtDate.EditFormat.FormatType = C1.Win.C1Input.FormatTypeEnum.CustomFormat; txtDate.EditFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(((((C1.Win.C1Input.FormatInfoInheritFlags.NullText | C1.Win.C1Input.FormatInfoInheritFlags.EmptyAsNull) | C1.Win.C1Input.FormatInfoInheritFlags.TrimStart) | C1.Win.C1Input.FormatInfoInheritFlags.TrimEnd) | C1.Win.C1Input.FormatInfoInheritFlags.CalendarType))); txtDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); txtDate.GMTOffset = System.TimeSpan.Parse("00:00:00"); txtDate.ImagePadding = new System.Windows.Forms.Padding(0); //size = bc.MeasureString(lbtxtDateStart); txtDate.Location = new System.Drawing.Point(scrW - txtDate.Width + 5, lbTxtPttHn.Location.Y); txtDate.Name = "txtDateStart"; txtDate.Size = new System.Drawing.Size(111, 20); txtDate.TabIndex = 12; txtDate.Tag = null; //theme1.SetTheme(this.txtDate, "(default)"); txtDate.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue; txtDate.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue; lbTxtDate = new Label(); lbTxtDate.Text = "Date :"; lbTxtDate.Font = fEdit; size = bc.MeasureString(lbTxtDate); lbTxtDate.Location = new System.Drawing.Point(txtDate.Location.X - size.Width - 5, lbTxtPttHn.Location.Y); lbTxtDate.AutoSize = true; lbTxtDate.Name = "lbTxtPttHn"; //new LogWriter("d", "FrmDoctorView setControlComponent End "); }
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 setConponent() { int gapLine = 30, gapX = 20, gapY = 20; Size size = new Size(); initGrfLeft(); initGrfImg(); lbMlFmCode = new Label(); lbMlFmCode.AutoSize = true; lbMlFmCode.BorderStyle = System.Windows.Forms.BorderStyle.None; lbMlFmCode.Font = fEdit; lbMlFmCode.ForeColor = System.Drawing.SystemColors.ControlText; lbMlFmCode.Location = new System.Drawing.Point(gapX, gapY); lbMlFmCode.Text = "Fm Code:"; txtMlFmCode = new C1TextBox(); txtMlFmCode.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; txtMlFmCode.Font = fEdit; txtMlFmCode.Width = 200; size = bc.MeasureString(lbMlFmCode); txtMlFmCode.Location = new System.Drawing.Point(lbMlFmCode.Location.X + size.Width + 15, lbMlFmCode.Location.Y); txtMlFmCode.Name = "txtMlFmCode"; txtMlFmCode.ReadOnly = true; gapY += gapLine; lbMlFmCodeNew = new Label(); lbMlFmCodeNew.AutoSize = true; lbMlFmCodeNew.BorderStyle = System.Windows.Forms.BorderStyle.None; lbMlFmCodeNew.Font = fEdit; lbMlFmCodeNew.ForeColor = System.Drawing.SystemColors.ControlText; lbMlFmCodeNew.Location = new System.Drawing.Point(gapX, gapY); lbMlFmCodeNew.Text = "Fm Code:"; txtMlFmCodeNew = new C1TextBox(); txtMlFmCodeNew.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; txtMlFmCodeNew.Width = 200; txtMlFmCodeNew.Font = fEdit; size = bc.MeasureString(lbMlFmCodeNew); txtMlFmCodeNew.Location = new System.Drawing.Point(lbMlFmCodeNew.Location.X + size.Width + 15, lbMlFmCodeNew.Location.Y); txtMlFmCodeNew.Name = "txtMlFmCodeNew"; btnUpdate = new C1Button(); btnUpdate.Name = "btnUpdate"; btnUpdate.Text = "Update Fm Code"; btnUpdate.Font = this.fEdit; size = new Size(120, 40); btnUpdate.Size = size; btnUpdate.Location = new Point(txtMlFmCodeNew.Location.X + txtMlFmCodeNew.Width + 40, lbMlFmCodeNew.Location.Y); //btnPrn.Click += BtnPrn_Click; btnFmCode = new C1Button(); btnFmCode.Name = "btnFmCode"; btnFmCode.Text = "Fm Code"; btnFmCode.Font = this.fEdit; size = new Size(120, 40); btnFmCode.Size = size; btnFmCode.Location = new Point(btnUpdate.Location.X + btnUpdate.Width + 40, lbMlFmCodeNew.Location.Y); gapY += gapLine; chkLimit = new C1CheckBox(); chkLimit.Text = "Limit 40 "; chkLimit.Name = "chkLimit"; chkLimit.Location = new Point(gapX, gapY); chkLimit.Checked = true; //pnRightTop.Controls.Add(btnUpdate); pnRightTop.Controls.Add(lbMlFmCode); pnRightTop.Controls.Add(txtMlFmCode); pnRightTop.Controls.Add(lbMlFmCodeNew); pnRightTop.Controls.Add(txtMlFmCodeNew); pnRightTop.Controls.Add(btnUpdate); pnRightTop.Controls.Add(chkLimit); pnRightTop.Controls.Add(btnFmCode); }
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); }