當前位置: 首頁>>代碼示例>>C#>>正文


C# PropertyGrid.ResumeLayout方法代碼示例

本文整理匯總了C#中System.Windows.Forms.PropertyGrid.ResumeLayout方法的典型用法代碼示例。如果您正苦於以下問題:C# PropertyGrid.ResumeLayout方法的具體用法?C# PropertyGrid.ResumeLayout怎麽用?C# PropertyGrid.ResumeLayout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Windows.Forms.PropertyGrid的用法示例。


在下文中一共展示了PropertyGrid.ResumeLayout方法的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();
        }
開發者ID:hazychill,項目名稱:oog,代碼行數:52,代碼來源:SettingsForm.cs


注:本文中的System.Windows.Forms.PropertyGrid.ResumeLayout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。