コード例 #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public DataGridViewIntegerInputColumn()
        {
            CellTemplate = new DataGridViewIntegerInputCell();

            _IngegerInput = new IntegerInput();

            _IngegerInput.BackgroundStyle.Class = ElementStyleClassKeys.DataGridViewNumericBorderKey;
            _IngegerInput.Visible = false;
        }
コード例 #2
0
 private void CreateValue(List<Node> re)
 {
     var value = new Node();
     value.Text = "Value";
     valueInput = new IntegerInput();
     valueInput.Value = Value;
     valueInput.ValueChanged += IntegerInput_ValueChanged;
     value.Nodes.Add(CreateControl("Value", "Value", valueInput));
     value.Expanded = true;
     re.Add(value);
 }
コード例 #3
0
ファイル: InfoEditor.cs プロジェクト: ilvmoney/hasuite-new
 private int? GetOptionalInt(IntegerInput textbox, CheckBoxX checkBox)
 {
     return checkBox.Checked ? (int?)textbox.Value : null;
 }
コード例 #4
0
ファイル: InfoEditor.cs プロジェクト: ilvmoney/hasuite-new
 private void LoadOptionalInt(int? source, IntegerInput target, CheckBoxX checkBox)
 {
     checkBox.Checked = source != null;
     if (source != null) target.Value = source.Value;
 }
コード例 #5
0
        public void HienThi(DataGridViewX dGV,
            BindingNavigator bN,
            TextBoxX txtMaLop,
            TextBoxX txtTenLop,
            ComboBoxEx cmbKhoiLop,
            ComboBoxEx cmbNamHoc,
            IntegerInput iniSiSo,
            ComboBoxEx cmbGiaoVien)
        {
            BindingSource bS = new BindingSource();
            bS.DataSource = m_LopData.LayDsLop();

            bN.BindingSource = bS;
            dGV.DataSource = bS;

            txtMaLop.DataBindings.Clear();
            txtMaLop.DataBindings.Add("Text", bS, "MaLop");

            txtTenLop.DataBindings.Clear();
            txtTenLop.DataBindings.Add("Text", bS, "TenLop");

            cmbKhoiLop.DataBindings.Clear();
            cmbKhoiLop.DataBindings.Add("SelectedValue", bS, "MaKhoiLop");

            cmbNamHoc.DataBindings.Clear();
            cmbNamHoc.DataBindings.Add("SelectedValue", bS, "MaNamHoc");

            iniSiSo.DataBindings.Clear();
            iniSiSo.DataBindings.Add("Text", bS, "SiSo");

            cmbGiaoVien.DataBindings.Clear();
            cmbGiaoVien.DataBindings.Add("SelectedValue", bS, "MaGiaoVien");
        }
コード例 #6
0
 private int? GetOptionalInt(CheckBoxX cbx, IntegerInput box)
 {
     if (cbx.Checked) return box.Value;
     else return null;
 }
コード例 #7
0
 private void LoadOptionalInt(int? value, CheckBoxX cbx, IntegerInput box)
 {
     if (value == null) cbx.Checked = false;
     else { cbx.Checked = true; box.Value = (int)value; }
 }
コード例 #8
0
        /// <summary>
        /// DrawText
        /// </summary>
        /// <param name="di"></param>
        /// <param name="r"></param>
        /// <param name="g"></param>
        private void DrawText(IntegerInput di, Rectangle r, Graphics g)
        {
            r.Inflate(-2, 0);

            eTextFormat tf = eTextFormat.VerticalCenter;

            switch (di.InputHorizontalAlignment)
            {
                case eHorizontalAlignment.Center:
                    tf |= eTextFormat.HorizontalCenter;
                    break;

                case eHorizontalAlignment.Right:
                    tf |= eTextFormat.Right;
                    break;
            }

            TextDrawing.DrawString(g, di.Text, di.Font, di.ForeColor, r, tf);
        }
コード例 #9
0
        /// <summary>
        /// DrawControl
        /// </summary>
        /// <param name="di"></param>
        /// <param name="r"></param>
        /// <param name="g"></param>
        private void DrawControl(IntegerInput di, Rectangle r, Graphics g)
        {
            GraphicsState gs = g.Save();

            try
            {
                g.TranslateTransform(r.X, r.Y);

                di.Width = r.Width;
                di.InternalPaint(new PaintEventArgs(g, Rectangle.Empty));
            }
            finally
            {
                g.Restore(gs);
            }
        }
コード例 #10
0
 private int? GetOptionalInt(CheckBoxX enabler, IntegerInput input)
 {
     return enabler.Checked ? (int?)input.Value : null;
 }
コード例 #11
0
 private void SetOptionalInt(int? value, CheckBoxX enabler, IntegerInput input)
 {
     if (value == null) enabler.Checked = false;
     else { enabler.Checked = true; input.Value = (int)value; }
 }