当前位置: 首页>>代码示例>>C#>>正文


C# TextBox.SuspendLayout方法代码示例

本文整理汇总了C#中System.Windows.Forms.TextBox.SuspendLayout方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.SuspendLayout方法的具体用法?C# TextBox.SuspendLayout怎么用?C# TextBox.SuspendLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.TextBox的用法示例。


在下文中一共展示了TextBox.SuspendLayout方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InitializeComponents

        private void InitializeComponents()
        {
            nameLabel = new Label();
              pathLabel = new Label();
              nameTextBox = new TextBox();
              pathTextBox = new TextBox();
              okButton = new Button();
              cancelButton = new Button();

              this.SuspendLayout();
              nameLabel.SuspendLayout();
              pathLabel.SuspendLayout();
              nameTextBox.SuspendLayout();
              pathTextBox.SuspendLayout();
              okButton.SuspendLayout();
              cancelButton.SuspendLayout();

              nameLabel.Text = "Name";
              nameLabel.AutoSize = true;
              nameLabel.Location = new Point(3, 3);

              pathLabel.Text = "Path";
              pathLabel.AutoSize = true;
              pathLabel.Location = new Point(3, 30);

              nameTextBox.Size = new Size(250, 19);
              nameTextBox.Location = new Point(40, 2);
              nameTextBox.BorderStyle = BorderStyle.FixedSingle;

              pathTextBox.Size = new Size(250, 19);
              pathTextBox.Location = new Point(40, 29);
              pathTextBox.BorderStyle = BorderStyle.FixedSingle;

              okButton.Text = "OK";
              okButton.Size = new Size(75, 23);
              okButton.Location = new Point((300-75)/2, 60);
              okButton.FlatStyle = FlatStyle.Flat;
              okButton.Click += delegate {
            this.DialogResult = DialogResult.OK;
            this.Close();
              };

              cancelButton.Text = "Cancel";
              cancelButton.Size = new Size(75, 23);
              cancelButton.Location = new Point(215, 60);
              cancelButton.FlatStyle = FlatStyle.Flat;
              cancelButton.Click += delegate {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
              };

              this.Size = new Size(300, 120);
              this.FormBorderStyle = FormBorderStyle.FixedSingle;
              this.Text = "Jump target";
              this.Controls.AddRange(new Control[]{
            nameLabel,
            pathLabel,
            nameTextBox,
            pathTextBox,
            okButton,
            cancelButton
              });

              nameLabel.ResumeLayout(false);
              pathLabel.ResumeLayout(false);
              nameTextBox.ResumeLayout(false);
              pathTextBox.ResumeLayout(false);
              okButton.ResumeLayout(false);
              cancelButton.ResumeLayout(false);
              this.ResumeLayout(false);
              this.PerformLayout();
        }
开发者ID:hazychill,项目名称:oog,代码行数:72,代码来源:AddJumpForm.cs

示例2: _WriteLog

 private static void _WriteLog(TextBox tb, string msg)
 {
     if (tb.InvokeRequired)
     {
         WriteLogCallback writeLog = new WriteLogCallback(_WriteLog);
         tb.Invoke(writeLog, tb, msg);
     }
     else
     {
         if (msg == null) return;
         if (tb.Lines.Length > 1000)
         {
             tb.SuspendLayout();
             string[] sLines = new string[900];
             Array.Copy(tb.Lines, tb.Lines.Length - 900, sLines, 0, 900);
             tb.Lines = sLines;
             tb.ResumeLayout();
         }
         tb.AppendText(msg);
     }
 }
开发者ID:labeuze,项目名称:source,代码行数:21,代码来源:MainForm.cs

示例3: Numeric

        public static TextBox Numeric(IXsdPart part, ToolTip tooltip = null)
        {
            try
            {
                if (String.IsNullOrWhiteSpace(part.Name))
                {
                    throw new ArgumentNullException();
                }
                var numeric = new TextBox();
                numeric.SuspendLayout();
                numeric.ForeColor = System.Drawing.Color.Black;
                numeric.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                numeric.Font = Methods.BaseFont;
                numeric.Size = new System.Drawing.Size(60, 21);
                //numeric.Minimum = 0;
                //numeric.Maximum = 65000;
                numeric.Name = "n" + part.Name;
                numeric.Text = String.IsNullOrWhiteSpace(part.Value) ? "" : part.Value;
                numeric.Tag = part;
                numeric.KeyPress += new System.Windows.Forms.KeyPressEventHandler(SpecialCaseHandlers.NumericNumberFilter);
                numeric.ResumeLayout();

                if (tooltip != null)
                {
                    tooltip.SetToolTip(numeric, part.Documentation);
                }

                return numeric;
            }
            catch (Exception ex)
            {
                return null;
            }
        }
开发者ID:jaffinito,项目名称:dotnet_configuration,代码行数:34,代码来源:Controls.cs

示例4: TextBox

        public static TextBox TextBox(IXsdPart part, ToolTip tooltip = null)
        {
            try
            {
                if (String.IsNullOrWhiteSpace(part.Name))
                {
                    throw new ArgumentNullException();
                }
                var textBox = new TextBox();
                textBox.SuspendLayout();
                textBox.BackColor = System.Drawing.Color.White;
                textBox.ForeColor = System.Drawing.Color.Black;
                textBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                textBox.Font = Methods.BaseFont;
                textBox.Name = "t" + part.Name;

                if (String.IsNullOrWhiteSpace(part.Value) && !Methods.StandAloneElement(part))
                {
                    textBox.Text = (part as Parts.Attribute).Default;
                }
                else
                {
                    textBox.Text = part.Value;
                }

                //Some textboxes will be empty but need to contain long strings.
                if (part.SpecialLength)
                {
                    textBox.Size = new System.Drawing.Size(200, 21);
                }
                else
                {
                    textBox.Size = new System.Drawing.Size(Methods.Width(textBox.Text), 21);
                }

                if (tooltip != null)
                {
                    tooltip.SetToolTip(textBox, part.Documentation);
                }

                textBox.Tag = part;

                textBox.ResumeLayout();
                return textBox;
            }
            catch (Exception ex)
            {
                return null;
            }
        }
开发者ID:jaffinito,项目名称:dotnet_configuration,代码行数:50,代码来源:Controls.cs

示例5: MultiLineTextBox

        public static TextBox MultiLineTextBox(Element element, ToolTip tooltip = null)
        {
            try
            {
                if (String.IsNullOrWhiteSpace(element.Name))
                {
                    throw new ArgumentNullException();
                }
                var textBox = new TextBox();
                textBox.SuspendLayout();
                textBox.BackColor = System.Drawing.Color.White;
                textBox.ForeColor = System.Drawing.Color.Black;
                textBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                textBox.Font = Methods.BaseFont;
                textBox.Name = "mlt" + element.Name;
                textBox.Multiline = true;
                textBox.ScrollBars = ScrollBars.Both;
                textBox.WordWrap = false;
                textBox.Validating += Methods.MultilineTextBox_Validating;
                textBox.KeyUp += Methods.MultilineTextBox_KeyPress;
                textBox.CausesValidationChanged += Methods.MultilineTextBox_CausesValidation;

                if (String.IsNullOrWhiteSpace(element.Value))
                {
                    //textBox.Text = (part as Attribute).Default;
                }
                else
                {
                    textBox.Text = element.Value;
                }

                textBox.Size = new System.Drawing.Size(300, 100);

                if (tooltip != null)
                {
                    tooltip.SetToolTip(textBox, element.Documentation);
                }

                textBox.Tag = element;

                textBox.ResumeLayout();
                return textBox;
            }
            catch (Exception ex)
            {
                return null;
            }
        }
开发者ID:jaffinito,项目名称:dotnet_configuration,代码行数:48,代码来源:Controls.cs


注:本文中的System.Windows.Forms.TextBox.SuspendLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。