Пример #1
0
        private GroupBox CreateRadioControl(YamlControl comp)
        {
            GroupBox container = new GroupBox
            {
                Anchor   = AnchorStyles.Top | AnchorStyles.Left,
                Size     = new System.Drawing.Size(165, 32),
                AutoSize = true,
                Name     = comp.name,
                TabStop  = false,
                Text     = comp.title
            };

            // then, add a list of radiobutton controls starting at height 3
            int currentHeight = 21;

            for (int i = 0; i < comp.options.Count; i++)
            {
                RadioButton btn = new RadioButton
                {
                    AutoSize = true,
                    Name     = comp.options[i].name,
                    Location = new Point(6, currentHeight),
                    Size     = new System.Drawing.Size(34, 17),
                    TabStop  = true,
                    Text     = comp.options[i].title,
                    UseVisualStyleBackColor = true
                };
                currentHeight += 23;
                container.Controls.Add(btn);
            }

            return(container);
        }
Пример #2
0
        private TextBox CreateTextBox(YamlControl comp)
        {
            TextBox tbx = new TextBox
            {
                Anchor    = AnchorStyles.Top | AnchorStyles.Left,
                Multiline = true,
                Name      = comp.name,
                Size      = new System.Drawing.Size(165, 103)
            };

            return(tbx);
        }
Пример #3
0
        private CheckBox CreateCheckBox(YamlControl comp)
        {
            CheckBox cbx = new CheckBox();

            cbx.Anchor    = AnchorStyles.Top | AnchorStyles.Left;
            cbx.AutoSize  = true;
            cbx.BackColor = SystemColors.ControlLightLight;
            cbx.ForeColor = SystemColors.ActiveCaptionText;
            cbx.Name      = comp.name;
            cbx.Size      = new Size(97, 17);
            cbx.Text      = comp.title;
            cbx.UseVisualStyleBackColor = false;
            return(cbx);
        }