Exemple #1
0
        /// <summary>
        /// 创建控件
        /// </summary>
        /// <param name="index"></param>
        private void CreateControl(int index, TXGroupBox ParenGroupBox)
        {
            TXGroupBox groupBox = new TXGroupBox();

            groupBox.Name         = groupBox.Name + index;
            groupBox.Text         = ParenGroupBox.Text.Substring(0, ParenGroupBox.Text.IndexOf('(')) + "(" + index + ")";
            groupBox.Size         = ParenGroupBox.Size;
            groupBox.CaptionColor = ParenGroupBox.CaptionColor;
            groupBox.CaptionFont  = ParenGroupBox.CaptionFont;
            groupBox.Font         = ParenGroupBox.Font;
            groupBox.Location     = new System.Drawing.Point(ParenGroupBox.Location.X, ((ParenGroupBox.Height + 5) * (index - 2)) + ParenGroupBox.Location.Y);
            groupBox.CaptionFont  = ParenGroupBox.CaptionFont;
            foreach (var item in ParenGroupBox.Controls)
            {
                if (item is SkinLabelEX)
                {
                    SkinLabelEX label    = new SkinLabelEX();
                    SkinLabelEX parnLabe = item as SkinLabelEX;
                    label.Location = new System.Drawing.Point(parnLabe.Location.X, parnLabe.Location.Y);
                    label.Text     = parnLabe.Text;
                    groupBox.Controls.Add(label);
                }
                if (item is NumberTextBoxEX)
                {
                    NumberTextBoxEX numBox         = new NumberTextBoxEX();
                    NumberTextBoxEX parenNumberBox = item as NumberTextBoxEX;
                    numBox.Location    = new System.Drawing.Point(parenNumberBox.Location.X, parenNumberBox.Location.Y);
                    numBox.Size        = parenNumberBox.Size;
                    numBox.Name        = parenNumberBox.Name.Replace(parenNumberBox.Name.Substring(parenNumberBox.Name.LastIndexOf('_') - 1, 1), index.ToString());
                    numBox.Tag         = parenNumberBox.Tag.ToString().Substring(0, 3) + "(" + index + ")" + labelText + ",number";
                    numBox.BorderStyle = parenNumberBox.BorderStyle;
                    numBox.TabIndex    = numBox.TabIndex + index;
                    groupBox.Controls.Add(numBox);
                }
                if (item is TXTextBoxEX)
                {
                    TXTextBoxEX txtBox      = new TXTextBoxEX();
                    TXTextBoxEX parenTxtBox = item as TXTextBoxEX;
                    txtBox.Location = new System.Drawing.Point(parenTxtBox.Location.X, parenTxtBox.Location.Y);
                    txtBox.Size     = parenTxtBox.Size;
                    txtBox.Name     = parenTxtBox.Name.Replace(parenTxtBox.Name.Substring(parenTxtBox.Name.LastIndexOf('_') - 1, 1), index.ToString());
                    groupBox.Controls.Add(txtBox);
                }
            }
            //this.panel1.Controls.Add(groupBox);
        }
Exemple #2
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 ///
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     this.btnOK      = new ERM.UI.Controls.SkinButtonEX();
     this.button1    = new ERM.UI.Controls.SkinButtonEX();
     this.txtInput   = new ERM.UI.Controls.TXTextBoxEX();
     this.lblPrompt  = new ERM.UI.Controls.SkinLabelEX();
     this.SuspendLayout();
     //
     // btnOK
     //
     //this.btnOK.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(197)))), ((int)(((byte)(225)))), ((int)(((byte)(247)))));
     this.btnOK.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
     this.btnOK.BackRectangle         = new System.Drawing.Rectangle(59, 23, 59, 23);
     this.btnOK.BaseColor             = System.Drawing.Color.Empty;
     this.btnOK.ControlState          = CCWin.SkinClass.ControlState.Normal;
     this.btnOK.Cursor       = System.Windows.Forms.Cursors.Hand;
     this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
     this.btnOK.DownBack     = null;
     this.btnOK.FlatAppearance.BorderSize = 0;
     this.btnOK.FlatStyle               = System.Windows.Forms.FlatStyle.Flat;
     this.btnOK.Font                    = new System.Drawing.Font("΢ÈíÑźÚ", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.btnOK.ForeColor               = System.Drawing.Color.Black;
     this.btnOK.Location                = new System.Drawing.Point(336, 57);
     this.btnOK.Margin                  = new System.Windows.Forms.Padding(3, 4, 3, 4);
     this.btnOK.MouseBack               = null;
     this.btnOK.MouseBaseColor          = System.Drawing.Color.SkyBlue;
     this.btnOK.Name                    = "btnOK";
     this.btnOK.NormlBack               = null;
     this.btnOK.Palace                  = true;
     this.btnOK.Radius                  = 10;
     this.btnOK.Size                    = new System.Drawing.Size(64, 23);
     this.btnOK.TabIndex                = 1;
     this.btnOK.Text                    = "È·¶¨";
     this.btnOK.UseVisualStyleBackColor = false;
     this.btnOK.Click                  += new System.EventHandler(this.btnOK_Click);
     //
     // button1
     //
     //this.button1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(197)))), ((int)(((byte)(225)))), ((int)(((byte)(247)))));
     this.button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None;
     this.button1.BackRectangle         = new System.Drawing.Rectangle(59, 23, 59, 23);
     this.button1.BaseColor             = System.Drawing.Color.Empty;
     this.button1.ControlState          = CCWin.SkinClass.ControlState.Normal;
     this.button1.Cursor       = System.Windows.Forms.Cursors.Hand;
     this.button1.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this.button1.DownBack     = null;
     this.button1.FlatAppearance.BorderSize = 0;
     this.button1.FlatStyle               = System.Windows.Forms.FlatStyle.Flat;
     this.button1.Font                    = new System.Drawing.Font("΢ÈíÑźÚ", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
     this.button1.ForeColor               = System.Drawing.Color.Black;
     this.button1.Location                = new System.Drawing.Point(336, 98);
     this.button1.Margin                  = new System.Windows.Forms.Padding(3, 4, 3, 4);
     this.button1.MouseBack               = null;
     this.button1.MouseBaseColor          = System.Drawing.Color.SkyBlue;
     this.button1.Name                    = "button1";
     this.button1.NormlBack               = null;
     this.button1.Palace                  = true;
     this.button1.Radius                  = 10;
     this.button1.Size                    = new System.Drawing.Size(64, 23);
     this.button1.TabIndex                = 2;
     this.button1.Text                    = "È¡Ïû";
     this.button1.UseVisualStyleBackColor = false;
     this.button1.Click                  += new System.EventHandler(this.button1_Click);
     //
     // txtInput
     //
     this.txtInput.Location = new System.Drawing.Point(12, 164);
     this.txtInput.Margin   = new System.Windows.Forms.Padding(3, 4, 3, 4);
     this.txtInput.Name     = "txtInput";
     this.txtInput.Size     = new System.Drawing.Size(396, 23);
     this.txtInput.TabIndex = 0;
     //
     // lblPrompt
     //
     this.lblPrompt.Location = new System.Drawing.Point(14, 61);
     this.lblPrompt.Name     = "lblPrompt";
     this.lblPrompt.Size     = new System.Drawing.Size(315, 95);
     this.lblPrompt.TabIndex = 3;
     //
     // InputBoxDialog
     //
     this.AcceptButton        = this.btnOK;
     this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
     this.BackColor           = System.Drawing.Color.FromArgb(((int)(((byte)(218)))), ((int)(((byte)(240)))), ((int)(((byte)(255)))));
     this.CancelButton        = this.button1;
     this.ClientSize          = new System.Drawing.Size(420, 204);
     this.Controls.Add(this.lblPrompt);
     this.Controls.Add(this.txtInput);
     this.Controls.Add(this.button1);
     this.Controls.Add(this.btnOK);
     this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
     this.Margin          = new System.Windows.Forms.Padding(3, 6, 3, 6);
     this.MaximizeBox     = false;
     this.MinimizeBox     = false;
     this.Name            = "InputBoxDialog";
     this.ShowInTaskbar   = false;
     this.Text            = "InputBox";
     this.Load           += new System.EventHandler(this.InputBox_Load);
     this.ResumeLayout(false);
     this.PerformLayout();
 }