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