private void LoadGrid(OptionInfo opt) { _propertyGridDefault = BuildOptionControl <PropertyGrid>(); _propertyGridDefault.SuspendLayout(); _propertyGridDefault.ToolbarVisible = false; _propertyGridDefault.SelectedObject = opt.Options; _propertyGridDefault.ResumeLayout(false); }
private PropertyGrid BuildPropertyGrid(int width, int height, OptionInfo opt) { PropertyGrid grid = new PropertyGrid(); grid.SuspendLayout(); grid.Location = new Point(0, 0); grid.Size = new Size(width, height); grid.Anchor = (AnchorStyles)(AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); grid.ToolbarVisible = false; grid.SelectedObject = opt.Options; grid.ResumeLayout(false); return(grid); }
private TabPage BuildTabPage(Size parentSize, int tabIndex, OptionInfo opt) { int pageWidth = parentSize.Width - 4; int pageHeight = parentSize.Height - 24; TabPage tabPage = new TabPage(); tabPage.SuspendLayout(); tabPage.Name = opt.Category; tabPage.Size = new Size(pageWidth, pageHeight); tabPage.Location = new Point(2, 22); tabPage.Text = tabPage.Name; tabPage.Padding = new Padding(0, 0, 0, 0); tabPage.TabIndex = tabIndex; tabPage.UseVisualStyleBackColor = true; tabPage.Controls.Add(BuildPropertyGrid(pageWidth, pageHeight, opt)); tabPage.ResumeLayout(false); return(tabPage); }