/// <summary> 
 /// Required method for Designer support - do not modify 
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     this.lblName = new Chummer.LabelWithToolTip();
     this.tlpMain = new Chummer.BufferedTableLayoutPanel(this.components);
     this.tlpMain.SuspendLayout();
     this.SuspendLayout();
     //
     // lblName
     //
     this.lblName.Anchor = System.Windows.Forms.AnchorStyles.Left;
     this.lblName.AutoSize = true;
     this.lblName.Location = new System.Drawing.Point(3, 5);
     this.lblName.Name = "lblName";
     this.lblName.Size = new System.Drawing.Size(66, 13);
     this.lblName.TabIndex = 6;
     this.lblName.Text = "[groupname]";
     this.lblName.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     this.lblName.ToolTipText = "";
     //
     // tlpMain
     //
     this.tlpMain.AutoSize = true;
     this.tlpMain.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.tlpMain.ColumnCount = 4;
     this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
     this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
     this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
     this.tlpMain.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
     this.tlpMain.Controls.Add(this.lblName, 0, 0);
     this.tlpMain.Dock = System.Windows.Forms.DockStyle.Fill;
     this.tlpMain.Location = new System.Drawing.Point(0, 0);
     this.tlpMain.Margin = new System.Windows.Forms.Padding(0);
     this.tlpMain.Name = "tlpMain";
     this.tlpMain.RowCount = 1;
     this.tlpMain.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
     this.tlpMain.Size = new System.Drawing.Size(215, 24);
     this.tlpMain.TabIndex = 25;
     //
     // SkillGroupControl
     //
     this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
     this.AutoSize = true;
     this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
     this.Controls.Add(this.tlpMain);
     this.DoubleBuffered = true;
     this.Margin = new System.Windows.Forms.Padding(0);
     this.Name = "SkillGroupControl";
     this.Size = new System.Drawing.Size(215, 24);
     this.MouseLeave += new System.EventHandler(this.OnMouseLeave);
     this.DpiChangedAfterParent += new System.EventHandler(this.SkillGroupControl_DpiChangedAfterParent);
     this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.OnMouseMove);
     this.tlpMain.ResumeLayout(false);
     this.tlpMain.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
예제 #2
0
        public static void AddControl(string type, string name, int indexOf, Point location, Size size, string text, Color color, EventHandler eventHandler, Control owner)
        {
            if (Forms.RobotAutomationHelper.Log)
            {
                Console.WriteLine(@"AddControl " + @" " + type + @" " + name + @" " + text);
            }
            Control tempControl;

            if (owner.Controls.Find(name, false).Length > 0)
            {
                //if (RobotAutomationHelper.Log)
                Console.WriteLine(name + @" | " + owner.Controls.Find(name, false).Length);
            }

            switch (type.ToLower())
            {
            case "textbox": tempControl = new TextBox(); break;

            case "textwithlist": tempControl = new TextWithList(owner as BaseKeywordAddForm, indexOf); break;

            case "checkbox": tempControl = new CheckBox(); ((CheckBox)tempControl).Checked = true; break;

            case "button": tempControl = new Button(); tempControl.Click += eventHandler; break;

            case "labelwithtooltip": tempControl = new LabelWithToolTip(); break;

            default: tempControl = new Label(); break;
            }

            tempControl.Name      = name;
            tempControl.Location  = location;
            tempControl.Size      = size;
            tempControl.Text      = text;
            tempControl.ForeColor = color;
            tempControl.Anchor    = (AnchorStyles.Top | AnchorStyles.Left);
            tempControl.Visible   = true;

            switch (type.ToLower())
            {
            case "textbox": owner.Controls.Add((TextBox)tempControl); break;

            case "textwithlist": owner.Controls.Add((TextWithList)tempControl); break;

            case "checkbox": owner.Controls.Add((CheckBox)tempControl); break;

            case "button": owner.Controls.Add((Button)tempControl); break;

            case "labelwithtooltip": owner.Controls.Add((LabelWithToolTip)tempControl); break;

            default: owner.Controls.Add((Label)tempControl); break;
            }
        }