Пример #1
0
        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);
        }