本文整理汇总了C#中System.Windows.Forms.PropertyGrid.SuspendLayout方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyGrid.SuspendLayout方法的具体用法?C# PropertyGrid.SuspendLayout怎么用?C# PropertyGrid.SuspendLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.PropertyGrid
的用法示例。
在下文中一共展示了PropertyGrid.SuspendLayout方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeComponents
private void InitializeComponents()
{
const int FORM_WIDTH = 400;
const int FORM_HEIGHT = 400;
propertyGrid = new PropertyGrid();
okButton = new Button();
cancelButton = new Button();
propertyGrid.SuspendLayout();
okButton.SuspendLayout();
cancelButton.SuspendLayout();
propertyGrid.Location = new Point(5, 5);
propertyGrid.Size = new Size(FORM_WIDTH-20, FORM_HEIGHT-80);
propertyGrid.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom;
propertyGrid.ToolbarVisible = false;
okButton.Location = new Point(FORM_WIDTH-75*2-40, FORM_HEIGHT-60);
okButton.Size = new Size(75, 23);
okButton.Text = "OK";
okButton.FlatStyle = FlatStyle.Flat;
okButton.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
okButton.Click += delegate {
this.DialogResult = DialogResult.OK;
this.Close();
};
cancelButton.Location = new Point(FORM_WIDTH-75-20, FORM_HEIGHT-60);
cancelButton.Size = new Size(75, 23);
cancelButton.Text = "Cancel";
cancelButton.FlatStyle = FlatStyle.Flat;
cancelButton.Anchor = AnchorStyles.Right | AnchorStyles.Bottom;
cancelButton.Click += delegate {
this.DialogResult = DialogResult.Cancel;
this.Close();
};
this.Size = new Size(FORM_WIDTH, FORM_HEIGHT);
this.FormBorderStyle = FormBorderStyle.SizableToolWindow;
this.Text = "Settings";
this.Controls.AddRange(new Control[]{
propertyGrid,
okButton,
cancelButton
});
propertyGrid.ResumeLayout(false);
okButton.ResumeLayout(false);
cancelButton.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}