本文整理汇总了C#中System.Windows.Forms.Form.SuspendLayout方法的典型用法代码示例。如果您正苦于以下问题:C# Form.SuspendLayout方法的具体用法?C# Form.SuspendLayout怎么用?C# Form.SuspendLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.Form
的用法示例。
在下文中一共展示了Form.SuspendLayout方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeComponent
/// <summary>
/// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
/// le contenu de cette méthode avec l'éditeur de code.
/// </summary>
protected void InitializeComponent()
{
this._elementHost1 = new System.Windows.Forms.Integration.ElementHost();
this._spatialViewerControl = new SpatialViewer_GDIHost();
_form = new System.Windows.Forms.Form();
_form.SuspendLayout();
//
// elementHost1
//
this._elementHost1.Dock = System.Windows.Forms.DockStyle.Fill;
this._elementHost1.Location = new System.Drawing.Point(0, 0);
this._elementHost1.Name = "elementHost1";
this._elementHost1.Size = new System.Drawing.Size(824, 581);
this._elementHost1.TabIndex = 0;
this._elementHost1.Text = "elementHost1";
this._elementHost1.Child = (UIElement)this._spatialViewerControl;
//
// Form1
//
_form.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F);
_form.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
_form.ClientSize = new System.Drawing.Size(824, 581);
_form.Controls.Add(this._elementHost1);
_form.Name = "Spatial Toolkit";
_form.Text = "Spatial Toolkit";
_form.ResumeLayout(false);
}
示例2: Init
public static void Init()
{
Settings.FULLSCREEN = !Settings.DevMode;
var frm = new Form() {
Text = "Tob Broadcast",
Size = new Size (480, 320),
Padding = new Padding (2),
Font = new Font ("Consolas", 10.0f),
FormBorderStyle = FormBorderStyle.FixedToolWindow,
MaximizeBox = false,
};
frm.SuspendLayout();
if (Settings.DevMode)
InitLocal (frm);
InitRemote (frm);
InitGeneral (frm);
frm.ResumeLayout();
_frm = frm;
Application.Run (frm);
}
示例3: loginPopup
/*
* Popup a webbrowser-window with the Oyatel Connect prompt.
* */
public void loginPopup()
{
_access_token = "";
popup = new Form();
canClosePopup = false;
WebBrowser webBrowser = new WebBrowser();
popup.SuspendLayout();
webBrowser.Location = new System.Drawing.Point(0, 0);
webBrowser.MinimumSize = new System.Drawing.Size(20, 20);
webBrowser.Name = "webBrowser";
webBrowser.Size = new System.Drawing.Size(880, 550);
popup.Width = 900;
popup.Height = 570;
popup.Text = "Oyatel Connect";
popup.Visible = true;
popup.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
popup.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
popup.ClientSize = new System.Drawing.Size(880, 550);
popup.Controls.Add(webBrowser);
popup.Name = "Oyatel.Connect";
popup.Text = "Oyatel Connect";
popup.ResumeLayout(false);
popup.PerformLayout();
webBrowser.Visible = true;
webBrowser.Navigated += new WebBrowserNavigatedEventHandler(navigated_event);
webBrowser.ProgressChanged += new WebBrowserProgressChangedEventHandler(ProgressChanged);
webBrowser.Navigate("https://oauth.oyatel.com/oauth/authorize?client_id="
+ client_id + "&response_type=token&redirect_uri=" + redirect_uri, false);
}
示例4: SetFontAndScaling
public static void SetFontAndScaling(Form form)
{
form.SuspendLayout();
form.Font = new Font("Tahoma", 8.25f);
if (form.Font.Name != "Tahoma") form.Font = new Font("Arial", 8.25f);
form.AutoScaleMode = AutoScaleMode.Font;
form.AutoScaleDimensions = new SizeF(6f, 13f);
form.ResumeLayout(false);
}
示例5: AskForPassword
public static string AskForPassword()
{
Form dialog = new Form();
dialog.FormBorderStyle = FormBorderStyle.FixedDialog;
System.Windows.Forms.Label label1;
MarkJohansen.Forms.MSJTextBox msjTextBox1;
MarkJohansen.Forms.MSJButton msjButton1;
label1 = new System.Windows.Forms.Label();
msjTextBox1 = new MarkJohansen.Forms.MSJTextBox();
msjButton1 = new MarkJohansen.Forms.MSJButton();
dialog.SuspendLayout();
//
// label1
//
label1.AutoSize = true;
label1.Location = new System.Drawing.Point(2, 8);
label1.Name = "label1";
label1.Size = new System.Drawing.Size(160, 13);
label1.TabIndex = 0;
label1.Text = "Please enter your DM password.";
//
// msjTextBox1
//
msjTextBox1.Location = new System.Drawing.Point(5, 25);
msjTextBox1.Name = "msjTextBox1";
msjTextBox1.Size = new System.Drawing.Size(285, 20);
msjTextBox1.TabIndex = 1;
//
// msjButton1
//
msjButton1.Location = new System.Drawing.Point(5, 51);
msjButton1.Name = "msjButton1";
msjButton1.Size = new System.Drawing.Size(285, 28);
msjButton1.TabIndex = 2;
msjButton1.Text = "OK";
msjButton1.Click += (sender, e) => { dialog.Close(); };
msjButton1.UseVisualStyleBackColor = true;
//
// Form1
//
dialog.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
dialog.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
dialog.ClientSize = new System.Drawing.Size(292, 84);
dialog.Controls.Add(msjButton1);
dialog.Controls.Add(msjTextBox1);
dialog.Controls.Add(label1);
dialog.Name = "Form1";
dialog.Text = "Form1";
dialog.ResumeLayout(false);
dialog.PerformLayout();
dialog.ShowDialog();
return msjTextBox1.Text;
}
示例6: InputBox
public static string InputBox(string Prompt = "", string Title = "", string DefaultResponse = "")
{
var textBox = new TextBox();
textBox.Location = new Point(12, 84);
textBox.Size = new Size(329, 19);
textBox.Text = DefaultResponse;
var okButton = new Button();
okButton.DialogResult = DialogResult.OK;
okButton.Location = new Point(266, 9);
okButton.Size = new Size(75, 23);
okButton.Text = "OK";
okButton.UseVisualStyleBackColor = true;
var cancelButton = new Button();
cancelButton.DialogResult = DialogResult.Cancel;
cancelButton.Location = new Point(266, 38);
cancelButton.Size = new Size(75, 23);
cancelButton.Text = "キャンセル";
cancelButton.UseVisualStyleBackColor = true;
var label = new Label();
label.AutoSize = true;
label.Location = new Point(12, 9);
label.Size = new Size(0, 12);
label.Text = Prompt;
var form = new Form();
form.SuspendLayout();
form.AcceptButton = okButton;
form.CancelButton = cancelButton;
form.AutoScaleDimensions = new SizeF(6F, 12F);
form.AutoScaleMode = AutoScaleMode.Font;
form.ClientSize = new Size(353, 120);
form.ControlBox = false;
form.Controls.Add(textBox);
form.Controls.Add(okButton);
form.Controls.Add(cancelButton);
form.Controls.Add(label);
form.FormBorderStyle = FormBorderStyle.FixedDialog;
form.ShowInTaskbar = false;
form.StartPosition = FormStartPosition.CenterParent;
form.ResumeLayout(false);
form.PerformLayout();
form.Text = Title;
if (form.ShowDialog() == DialogResult.OK) return textBox.Text;
else return null;
}
示例7: InitTitle
/// <summary>
/// Init title all the control in form
/// </summary>
/// <param name="frm"></param>
/// <remarks>
/// Author: PhatLT. FPTSS.
/// Created date: 14/02/2011
/// </remarks>
public static void InitTitle(Form frm)
{
if(frm == null)
return;
frm.SuspendLayout();
frm.Text = clsResources.GetTitle(frm.Name + ".Title");
foreach(Control control in frm.Controls)
{
InitTitle(frm, control);
}
frm.ResumeLayout(false);
}
示例8: LoadFromRegistry
/// <summary>
/// Loads the position and size of a form.
/// Best placed in the Form's constructor.
/// </summary>
/// <param name="form">The control to be loaded.</param>
public static void LoadFromRegistry(
Form form)
{
if (form == null)
{
throw new ArgumentNullException("form");
}
// open key
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(SUBKEY))
{
try
{
// check that screen res is the same
// if not or can't be found revert to origional.
if ((Screen.PrimaryScreen.Bounds.Height != (int)key.GetValue(form.Name + "_screenHeight"))
|| (Screen.PrimaryScreen.Bounds.Width != (int)key.GetValue(form.Name + "_screenWidth")))
{
return;
}
form.SuspendLayout();
try
{
form.WindowState = (FormWindowState)key.GetValue(form.Name + "_windowState");
form.StartPosition = FormStartPosition.Manual;
form.Top = (int)key.GetValue(form.Name + "_top");
form.Left = (int)key.GetValue(form.Name + "_left");
form.Width = (int)key.GetValue(form.Name + "_width");
form.Height = (int)key.GetValue(form.Name + "_height");
}
finally
{
form.ResumeLayout();
}
}
catch (Exception)
{
// Nothing to do.
}
}
}
示例9: CreateForm
public static Form CreateForm(GViewer gviewer) {
GViewer=gviewer;
var form = new Form();
form.SuspendLayout();
form.Controls.Add(gviewer);
gviewer.Dock = DockStyle.Fill;
gviewer.SendToBack();
form.StartPosition = FormStartPosition.CenterScreen;
form.Size = new System.Drawing.Size(Screen.PrimaryScreen.WorkingArea.Width,
Screen.PrimaryScreen.WorkingArea.Height);
var statusStrip = new StatusStrip();
var toolStribLbl = new ToolStripStatusLabel("test");
statusStrip.Items.Add(toolStribLbl);
form.Controls.Add(statusStrip);
form.MainMenuStrip = GetMainMenuStrip();
form.Controls.Add(form.MainMenuStrip);
form.ResumeLayout();
form.Load += form_Load;
return form;
}
示例10: Show
/// <summary>
/// Opens a new modeless dialog box with a grid
/// </summary>
/// <param name="node">the node to display</param>
/// <param name="owner">the parent form to attach to, can be null</param>
/// <returns>the form containing the grid</returns>
public static Form Show(NsNode node, Form owner)
{
Form f = new Form();
f.Owner = owner;
f.SuspendLayout();
NsNodeGridView flow = new NsNodeGridView();
flow.Dock = DockStyle.Fill;
f.Controls.Add(flow);
f.ResumeLayout();
flow.Node = node;
f.StartPosition = FormStartPosition.CenterParent;
f.FormBorderStyle = FormBorderStyle.SizableToolWindow;
f.Width = 600;
f.Height = 300;
f.Text = node.Label;
f.Show();
f.BringToFront();
flow.ReadNode();
return f;
}
示例11: LabelManager
public LabelManager(Form p, int m)
{
maxNumItems = m;
items = new List<ResultItem>(0);
labels = new Label[maxNumItems];
p.SuspendLayout();
for (int i = 0; i < maxNumItems; i++)
{
labels[i] = new Label();
labels[i].AutoEllipsis = true;
labels[i].BackColor = Color.White;
labels[i].Font = new Font("Microsoft Sans Serif", 18F, FontStyle.Regular, GraphicsUnit.Point, 0);
labels[i].Location = new Point(100, 110 + (i * 50));
labels[i].Size = new Size(1050, 30);
labels[i].TextAlign = ContentAlignment.MiddleCenter;
p.Controls.Add(labels[i]);
}
p.ResumeLayout();
p.PerformLayout();
}
示例12: GenreSelectorDialog
public GenreSelectorDialog(TrackDatabase db)
{
mDatabase = db;
mGenres = mDatabase.GetGenres();
mSelectedGenres = new string[0];
mForm = new Form();
mForm.SuspendLayout();
mForm.Text = "Genre Selection";
mForm.MinimizeBox = false;
mForm.MaximizeBox = false;
mForm.FormBorderStyle = FormBorderStyle.FixedDialog;
mForm.StartPosition = FormStartPosition.CenterScreen;
mForm.Size = new Size(200, 250);
mGenreCheckList = new CheckedListBox();
mGenreCheckList.CheckOnClick = true;
mGenreCheckList.IntegralHeight = false;
mGenreCheckList.Location = new Point(3, 3);
mGenreCheckList.Size = new Size(mForm.ClientSize.Width - 6, mForm.ClientSize.Height - 32);
mGenreCheckList.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
foreach (string genre in mGenres)
mGenreCheckList.Items.Add(String.Format("{0} ({1})", genre, mDatabase.GetGenreTrackCount(genre)), true);
mForm.Controls.Add(mGenreCheckList);
mOKButton = new Button();
//mOKButton.DialogResult = DialogResult.OK;
mOKButton.Text = "OK";
mOKButton.Location = new Point(mForm.ClientSize.Width - 78, mForm.ClientSize.Height - 26);
mOKButton.Size = new Size(75, 23);
mOKButton.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
mOKButton.Click += new EventHandler(mOKButton_Click);
mForm.Controls.Add(mOKButton);
mForm.AcceptButton = mOKButton;
mForm.ResumeLayout();
}
示例13: Show
public static Form Show(ILogger log, Form owner)
{
Form f = new Form();
f.Owner = owner;
f.SuspendLayout();
LogTextBox box = new LogTextBox();
box.Dock = DockStyle.Fill;
box.SetLogText(log);
box.AttachLog(log);
f.Controls.Add(box);
f.ResumeLayout();
f.StartPosition = FormStartPosition.CenterParent;
f.FormBorderStyle = FormBorderStyle.SizableToolWindow;
f.Width = 500;
f.Height = 300;
f.Text = "";
f.Show();
f.BringToFront();
return f;
}
示例14: RestorePlacement
private void RestorePlacement(Form senderForm, FormPlacement restore)
{
senderForm.SuspendLayout();
if (((restore & FormPlacement.Location) > FormPlacement.None) && (this["Location"] != null))
{
Screen screen = Screen.FromPoint(this.Location);
if ((screen != null) && screen.Bounds.Contains(this.Location))
{
senderForm.StartPosition = FormStartPosition.Manual;
senderForm.Location = this.Location;
}
}
if (((restore & FormPlacement.Size) > FormPlacement.None) && (this["Size"] != null))
{
senderForm.Size = this.Size;
}
if ((restore & FormPlacement.WindowState) > FormPlacement.None)
{
senderForm.WindowState = this.WindowState;
}
senderForm.ResumeLayout();
}
示例15: Bug81843
public void Bug81843 ()
{
Form f = new Form ();
f.ShowInTaskbar = false;
TableLayoutPanel tableLayoutPanel1;
Button button2;
TextBox textBox1;
Button button4;
tableLayoutPanel1 = new TableLayoutPanel ();
button2 = new Button ();
button4 = new Button ();
textBox1 = new TextBox ();
tableLayoutPanel1.SuspendLayout ();
f.SuspendLayout ();
tableLayoutPanel1.AutoSize = true;
tableLayoutPanel1.ColumnCount = 3;
tableLayoutPanel1.ColumnStyles.Add (new ColumnStyle ());
tableLayoutPanel1.ColumnStyles.Add (new ColumnStyle ());
tableLayoutPanel1.ColumnStyles.Add (new ColumnStyle ());
tableLayoutPanel1.Controls.Add (button2, 0, 1);
tableLayoutPanel1.Controls.Add (button4, 2, 1);
tableLayoutPanel1.Controls.Add (textBox1, 1, 0);
tableLayoutPanel1.Location = new Point (0, 0);
tableLayoutPanel1.RowCount = 2;
tableLayoutPanel1.RowStyles.Add (new RowStyle (SizeType.Percent, 50F));
tableLayoutPanel1.RowStyles.Add (new RowStyle (SizeType.Percent, 50F));
tableLayoutPanel1.Size = new Size (292, 287);
button2.Size = new Size (75, 23);
button4.Size = new Size (75, 23);
textBox1.Dock = DockStyle.Fill;
textBox1.Location = new Point (84, 3);
textBox1.Multiline = true;
textBox1.Size = new Size (94, 137);
f.ClientSize = new Size (292, 312);
f.Controls.Add (tableLayoutPanel1);
f.Name = "Form1";
f.Text = "Form1";
tableLayoutPanel1.ResumeLayout (false);
tableLayoutPanel1.PerformLayout ();
f.ResumeLayout (false);
f.PerformLayout ();
f.Show ();
Assert.AreEqual (new Rectangle (3, 146, 75, 23), button2.Bounds, "A1");
Assert.AreEqual (new Rectangle (184, 146, 75, 23), button4.Bounds, "A2");
Assert.AreEqual (new Rectangle (84, 3, 94, 137), textBox1.Bounds, "A3");
f.Dispose ();
}