예제 #1
0
        private void addControlCombo(Label lbl, t_shopping dishinfo, DevExpress.XtraEditors.TextEdit tbx)
        {
            TComboFromControl cfc = new TComboFromControl();

            lbl.Parent    = pnlMain;
            lbl.Left      = 18;
            lbl.Top       = onlycontrols.Count * lblHeight + combocontrols.Count * (lblHeight) + comboheight;
            cfc.lbl       = lbl;
            lbl.Font      = lblSimple.Font;
            lbl.Height    = lblHeight;
            lbl.ForeColor = lblSimple.ForeColor;
            lbl.AutoSize  = false;
            lbl.Width     = 528;
            cfc.ispot     = false;
            cfc.dishinfo  = dishinfo;
            if (tbx != null)
            {
                tbx.Parent = pnlMain;
                tbx.Left   = 10;
                tbx.Font   = edtNum1.Font;
                tbx.Top    = lbl.Top - 5;// +lblHeight;
                tbx.Left   = edtNum1.Left;
                tbx.Width  = edtNum1.Width;
                cfc.edt    = tbx;
            }
            combocontrols.Add(cfc);
        }
예제 #2
0
        private void addControl(Label lbl, t_shopping dishinfo, DevExpress.XtraEditors.TextEdit tbx)
        {
            TComboFromControl cfc = new TComboFromControl();

            lbl.Parent    = pnlMain;
            lbl.Left      = 0;
            lbl.Top       = onlycontrols.Count * lblHeight + combocontrols.Count * (lblHeight) + comboheight; // onlycontrols.Count* lblHeight;
            cfc.lbl       = lbl;
            lbl.Font      = lblSimple.Font;
            lbl.Height    = lblHeight;
            lbl.ForeColor = lblSimple.ForeColor;
            lbl.AutoSize  = false;
            lbl.Width     = 528;
            cfc.ispot     = false;
            cfc.dishinfo  = dishinfo;
            onlycontrols.Add(cfc);
        }
예제 #3
0
        private void edtNum1_EditValueChanged(object sender, EventArgs e)
        {
            //
            DevExpress.XtraEditors.TextEdit edt = (DevExpress.XtraEditors.TextEdit)sender;
            TCombo combo    = (TCombo)edt.Tag;
            string lblname  = "lbl" + combo.Columnid;
            Label  lbl      = (Label)this.Controls.Find(lblname, true)[0];
            TCombo comb     = (TCombo)edt.Tag;
            int    groupnum = 0;

            for (int i = 0; i <= combocontrols.Count - 1; i++)
            {
                TComboFromControl cfc = (TComboFromControl)combocontrols[i];
                if (((TCombo)cfc.edt.Tag).Columnid == comb.Columnid)
                {
                    groupnum = groupnum + strtointdef0(cfc.edt.Text);
                }
            }
            if (groupnum > combo.Endnum)
            {
                for (int i = 0; i <= combocontrols.Count - 1; i++)
                {
                    TComboFromControl cfc = (TComboFromControl)combocontrols[i];
                    if (((TCombo)cfc.edt.Tag).Columnid == comb.Columnid)
                    {
                        cfc.edt.Text = "";
                        cfc.edt.Refresh();
                        groupnum = 0;
                    }
                }
            }
            else
            if (combo.Endnum == groupnum)
            {
                lbl.BackColor = lblCombo2.BackColor;
            }
            else
            {
                lbl.BackColor = lblCombo.BackColor;
            }
            String dishStr = String.Format("{0}({1}选{2})->已选:{3}                               ", combo.ItemDesc, combo.Startnum, combo.Endnum, groupnum);

            lbl.Text = dishStr;
        }
예제 #4
0
        private void setedtNum(DevExpress.XtraEditors.TextEdit edt)
        {
            TCombo comb = (TCombo)edt.Tag;

            if (comb.Endnum == 1)
            {
                for (int i = 0; i <= combocontrols.Count - 1; i++)
                {
                    TComboFromControl cfc = (TComboFromControl)combocontrols[i];
                    if (((TCombo)cfc.edt.Tag).Columnid == comb.Columnid)
                    {
                        cfc.edt.Text = "";
                    }
                }

                edt.Text = "1";
                edt.SelectAll();
            }
        }