private void InitControl()
        {
            if (ListMaPhieu.Count == 0)
            {
                PLMessageBox.ShowNotificationMessage("Chưa có mã phiếu để cấu hình!");
                HelpXtraForm.CloseFormHasConfirm(this);
                return;
            }
            int x = 7;
            int y = 25;

            foreach (int key in ListMaPhieu.Keys)
            {
                Label lbl = new Label();
                lbl.Text = "Mẫu phiếu " + ListMaPhieu[key].Split(';')[1];
                lbl.Location = new System.Drawing.Point(x, y + 5);
                //lbl.AutoSize = false;
                lbl.Size = new System.Drawing.Size(150, lbl.Size.Height);
                this.groupControlConfig.Controls.Add(lbl);

                PatternSelect ps = new PatternSelect();
                ps.Name = "PS" + key;
                ps.Location = new System.Drawing.Point(x + lbl.Size.Width + 20, y);
                this.groupControlConfig.Controls.Add(ps);

                ps.f_setValue(ListMaPhieu[key].Split(';')[0]);

                TextEdit txt = new TextEdit();
                txt.Name = "TXT" + key;
                txt.Location = new System.Drawing.Point(x, y + 3);
                txt.Properties.ReadOnly = true;
                txt.Size = new System.Drawing.Size(154, 20);
                this.groupControlExample.Controls.Add(txt);

                txt.Text = DatabaseFB.getSoPhieu(ps.f_getValue());

                y += 25;
            }

            groupControlConfig.Location = new System.Drawing.Point(12, 6);

            groupControlConfig.Size = new System.Drawing.Size(
                 groupControlConfig.Controls[groupControlConfig.Controls.Count - 1].Location.X + groupControlConfig.Controls[groupControlConfig.Controls.Count - 1].Size.Width + 10,
                 groupControlConfig.Controls[groupControlConfig.Controls.Count - 1].Location.Y + 30);

            groupControlExample.Location = new System.Drawing.Point(groupControlConfig.Size.Width + 40, 6);
            groupControlExample.Size = new System.Drawing.Size(groupControlExample.Controls[0].Size.Width + 10,
                groupControlConfig.Size.Height);
            this.Size = new System.Drawing.Size(
                groupControlConfig.Location.X + groupControlConfig.Size.Width + groupControlExample.Size.Width + 40,
                groupControlConfig.Location.Y + groupControlConfig.Size.Height + flowLayoutPanel1.Size.Height + 30);
        }
Example #2
0
        private void InitControl()
        {
            //button
            //this.btnXemTruoc.Image = FWImageDic.PREVIEW_IMAGE16;

            int newMainPanleHeght = 0;
            //if (ListMaPhieu.Count == 0)
            //{
            //    HelpMsgBox.ShowNotificationMessage("Chưa có mã phiếu để cấu hình!");
            //    HelpXtraForm.CloseFormHasConfirm(this);
            //    return;
            //}

            foreach (int key in ListMaPhieu.Keys)
            {
                PatternSelect ps = new PatternSelect();
                ps.Name = "PS" + key;
                this.flowLayoutPanelPattern.Controls.Add(ps);
                ps.f_setValue(ListMaPhieu[key].Split(';')[0]);

                LabelControl lbl = new LabelControl();
                lbl.Text = ListMaPhieu[key].Split(';')[1];
                lbl.ToolTip = lbl.Text;
                lbl.AutoSizeMode = LabelAutoSizeMode.None;
                lbl.AutoEllipsis = true;
                lbl.Size = new System.Drawing.Size(flowLayoutPanelLabel.Size.Width - 20, ps.Size.Height);
                this.flowLayoutPanelLabel.Controls.Add(lbl);

                TextEdit txt = new TextEdit();
                txt.Name = "TXT" + key;
                txt.Properties.ReadOnly = true;
                txt.Properties.AutoHeight = false;
                txt.TabStop = false;
                txt.Size = new System.Drawing.Size(flowLayoutPanelDemo.Size.Width - 8, ps.Size.Height);
                this.flowLayoutPanelDemo.Controls.Add(txt);
                //  txt.Text = DatabaseFB.getSoPhieu(ps.f_getValue());

            }
            newMainPanleHeght = flowLayoutPanelPattern.Size.Height + 30;
            if (MaxMainPanelHeigh > newMainPanleHeght)
            {
                MaxMainPanelHeigh = newMainPanleHeght;
            }
            panelControlSoPhieu.Dock = DockStyle.Fill;
            this.xtraScrollableControlConfig.VerticalScroll.Enabled = false;
            //duchs: cho hien cau hinh minh hoa
            try
            {
                foreach (int key in ListMaPhieu.Keys)
                {
                    PatternSelect ps = flowLayoutPanelPattern.Controls["PS" + key] as PatternSelect;
                    TextEdit txt = flowLayoutPanelDemo.Controls["TXT" + key] as TextEdit;
                    txt.Text = DatabaseFB.getSoPhieu(ps.f_getValue());
                }
            }
            catch { }
        }