コード例 #1
0
        /// <summary>
        /// 등록되는 체크박스 버튼 프리셋
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        private Control[] CreateCheckBox(MenuDetail item)
        {
            CheckBox cb = new CheckBox();

            cb.Name            = item.InventoryName;
            cb.Text            = item.InventoryName;
            cb.Checked         = item.Compulsory;
            cb.CheckedChanged += Cbx_CheckedChanged;

            Label lblAmount = new Label();

            lblAmount.Text = "사용량";
            MaterialLabelFormatter(lblAmount);

            NumericUpDown nudAmount = new NumericUpDown();

            nudAmount.Value   = item.Amount;
            nudAmount.Name    = item.InventoryName;
            nudAmount.Size    = new Size(40, 21);
            nudAmount.Enabled = item.Compulsory;

            return(new Control[] { cb, lblAmount, nudAmount });
        }
コード例 #2
0
        /// <summary>
        /// 등록되는 라디오 버튼 프리셋
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        private Control[] CreateRadioButton(MenuDetail item)
        {
            RadioButton rb = new RadioButton();

            rb.Name            = item.InventoryName;
            rb.Text            = item.InventoryName;
            rb.Checked         = item.Compulsory;
            rb.CheckedChanged += Radio_CheckedChanged;

            Label lblAmount = new Label();

            lblAmount.Text = "사용량";
            MaterialLabelFormatter(lblAmount);

            NumericUpDown nudAmount = new NumericUpDown();

            nudAmount.Value   = item.Amount;
            nudAmount.Name    = item.InventoryName;
            nudAmount.Size    = new Size(40, 21);
            nudAmount.Enabled = item.Compulsory;

            return(new Control[] { rb, lblAmount, nudAmount });
        }