本文整理汇总了C#中System.Windows.Forms.PropertyGrid类的典型用法代码示例。如果您正苦于以下问题:C# PropertyGrid类的具体用法?C# PropertyGrid怎么用?C# PropertyGrid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyGrid类属于System.Windows.Forms命名空间,在下文中一共展示了PropertyGrid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PropertyValueChanged
public void PropertyValueChanged(PropertyValueChangedEventArgs e, PropertyGrid mPropertyGrid)
{
UnreferencedFilesManager.Self.ProcessRefreshOfUnreferencedFiles();
#region Check for Errors
if (mPropertyGrid == null)
{
System.Windows.Forms.MessageBox.Show("There has been an internal error in Glue related to updating the PropertyGrid. This likely happens if there has been an earlier error in Glue. You should probably restart Glue.");
MainGlueWindow.Self.HasErrorOccurred = true;
}
#endregion
string changedMember = e.ChangedItem.PropertyDescriptor.Name;
object oldValue = e.OldValue;
string variableName = e.ChangedItem.Label;
string parentGridItemName = null;
if (e.ChangedItem != null && e.ChangedItem.Parent != null)
{
parentGridItemName = e.ChangedItem.Parent.Label;
}
ReactToPropertyChanged(changedMember, oldValue, variableName, parentGridItemName);
}
示例2: AttachRefresherEventHandler
/// <summary>
/// Attaches the <see cref="RefresherEventHandler"/> to a <see cref="PropertyGrid"/>.
/// </summary>
/// <param name="pg">The <see cref="PropertyGrid"/> to attach the event to.</param>
public static void AttachRefresherEventHandler(PropertyGrid pg)
{
if (pg == null)
return;
pg.SelectedGridItemChanged += RefresherEventHandler;
}
示例3: DashboardGroupNameDialog
public DashboardGroupNameDialog(PropertyGrid sourceGrid, DashboardPropertyGroup group)
{
m_sourceGrid = sourceGrid;
m_group = @group;
InitializeComponent();
groupNameText.Text = group.PropertyName;
}
示例4: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.grid = new System.Windows.Forms.PropertyGrid();
this.splitter1 = new System.Windows.Forms.Splitter();
this.tboxElementHtml = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// grid
//
this.grid.BackColor = System.Drawing.SystemColors.Control;
this.grid.CommandsVisibleIfAvailable = true;
this.grid.Dock = System.Windows.Forms.DockStyle.Right;
this.grid.HelpVisible = false;
this.grid.LargeButtons = false;
this.grid.LineColor = System.Drawing.SystemColors.ScrollBar;
this.grid.Location = new System.Drawing.Point(376, 0);
this.grid.Name = "grid";
this.grid.PropertySort = System.Windows.Forms.PropertySort.Categorized;
this.grid.Size = new System.Drawing.Size(232, 310);
this.grid.TabIndex = 0;
this.grid.Text = "propertyGrid1";
this.grid.ViewBackColor = System.Drawing.Color.White;
this.grid.ViewForeColor = System.Drawing.SystemColors.WindowText;
//
// splitter1
//
this.splitter1.Dock = System.Windows.Forms.DockStyle.Right;
this.splitter1.Location = new System.Drawing.Point(373, 0);
this.splitter1.Name = "splitter1";
this.splitter1.Size = new System.Drawing.Size(3, 310);
this.splitter1.TabIndex = 1;
this.splitter1.TabStop = false;
//
// tboxElementHtml
//
this.tboxElementHtml.BackColor = System.Drawing.Color.White;
this.tboxElementHtml.Dock = System.Windows.Forms.DockStyle.Fill;
this.tboxElementHtml.Location = new System.Drawing.Point(0, 0);
this.tboxElementHtml.Multiline = true;
this.tboxElementHtml.Name = "tboxElementHtml";
this.tboxElementHtml.ReadOnly = true;
this.tboxElementHtml.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.tboxElementHtml.Size = new System.Drawing.Size(373, 310);
this.tboxElementHtml.TabIndex = 2;
this.tboxElementHtml.Text = "";
//
// ElementProperties
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(608, 310);
this.Controls.Add(this.tboxElementHtml);
this.Controls.Add(this.splitter1);
this.Controls.Add(this.grid);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Name = "ElementProperties";
this.Text = "Element Properties";
this.Resize += new System.EventHandler(this.ElementProperties_Resize);
this.ResumeLayout(false);
}
示例5: InitializeComponent
private void InitializeComponent()
{
this.groupBox1 = new GroupBox();
this.propertyGrid = new PropertyGrid();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
this.groupBox1.Controls.Add((Control) this.propertyGrid);
this.groupBox1.Location = new Point(16, 16);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new Size(368, 328);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Settings";
this.propertyGrid.Dock = DockStyle.Fill;
this.propertyGrid.HelpVisible = false;
this.propertyGrid.Location = new Point(3, 16);
this.propertyGrid.Name = "propertyGrid";
this.propertyGrid.Size = new Size(362, 309);
this.propertyGrid.TabIndex = 0;
this.propertyGrid.ToolbarVisible = false;
this.propertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(this.propertyGrid_PropertyValueChanged);
this.AutoScaleDimensions = new SizeF(6f, 13f);
this.Controls.Add((Control) this.groupBox1);
this.Name = "EditorOptionsPanel";
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
示例6: Show
/// <summary>
/// Shows a dialog box with a property grid.
/// </summary>
/// <param name="title"></param>
/// <param name="value"></param>
/// <returns></returns>
public static DialogResult Show(string title, ref Entity_cl value)
{
Form mForm = new Form();
PropertyGrid mPropertyGrid = new PropertyGrid();
Button mOKButton = new Button();
mForm.Text = title + " Properties";
mPropertyGrid.SelectedObject = value;
mOKButton.Text = "OK";
mOKButton.DialogResult = DialogResult.OK;
mForm.ClientSize = new Size(320, 320);
mPropertyGrid.SetBounds(4, 4, mForm.ClientSize.Width - 4, mForm.ClientSize.Height - 40);
mOKButton.SetBounds(mForm.ClientSize.Width / 2 - 32, mForm.ClientSize.Height - 36, 64, 22);
mPropertyGrid.Anchor = AnchorStyles.Top;
mOKButton.Anchor = AnchorStyles.Bottom;
mForm.Controls.AddRange(new Control[] { mPropertyGrid, mOKButton });
mForm.FormBorderStyle = FormBorderStyle.FixedSingle;
mForm.StartPosition = FormStartPosition.CenterScreen;
mForm.MinimizeBox = false;
mForm.MaximizeBox = false;
mForm.AcceptButton = mOKButton;
DialogResult dialogResult = mForm.ShowDialog();
return dialogResult;
}
示例7: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
this.SuspendLayout();
//
// propertyGrid1
//
this.propertyGrid1.CommandsVisibleIfAvailable = true;
this.propertyGrid1.LargeButtons = false;
this.propertyGrid1.LineColor = System.Drawing.SystemColors.ScrollBar;
this.propertyGrid1.Location = new System.Drawing.Point(8, 12);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.Size = new System.Drawing.Size(384, 200);
this.propertyGrid1.TabIndex = 0;
this.propertyGrid1.Text = "propertyGrid1";
this.propertyGrid1.ViewBackColor = System.Drawing.SystemColors.Window;
this.propertyGrid1.ViewForeColor = System.Drawing.SystemColors.WindowText;
//
// frmSample31
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(400, 241);
this.Controls.Add(this.propertyGrid1);
this.Name = "frmSample31";
this.Text = "Application settings";
this.ResumeLayout(false);
}
示例8: GridEntry
// Cannot use one PropertyDescriptor for all owners, because the
// propertydescriptors might have different Invokees. Check
// ReflectionPropertyDescriptor.GetInvokee and how it's used.
//
public GridEntry (PropertyGrid propertyGrid, PropertyDescriptor[] properties,
GridEntry parent) : this (propertyGrid, parent)
{
if (properties == null || properties.Length == 0)
throw new ArgumentNullException ("prop_desc");
property_descriptors = properties;
}
示例9: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.prpg = new System.Windows.Forms.PropertyGrid();
this.SuspendLayout();
//
// prpg
//
this.prpg.CommandsVisibleIfAvailable = true;
this.prpg.Dock = System.Windows.Forms.DockStyle.Fill;
this.prpg.LargeButtons = false;
this.prpg.LineColor = System.Drawing.SystemColors.ScrollBar;
this.prpg.Name = "prpg";
this.prpg.Size = new System.Drawing.Size(280, 429);
this.prpg.TabIndex = 0;
this.prpg.Text = "propertyGrid1";
this.prpg.ViewBackColor = System.Drawing.SystemColors.Window;
this.prpg.ViewForeColor = System.Drawing.SystemColors.WindowText;
//
// PropertyInspector
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(280, 429);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.prpg});
this.Name = "PropertyInspector";
this.Text = "Property Inspector";
this.ResumeLayout(false);
}
示例10: Main
public static void Main(string[] args)
{
var win = new OpenTK.GameWindow (200, 200, GraphicsMode.Default, "", OpenTK.GameWindowFlags.Default);
var form1 = new Form ();
form1.Size = new Size(400, 1000);
PropertyGrid propertyGrid1 = new PropertyGrid ();
propertyGrid1.CommandsVisibleIfAvailable = true;
propertyGrid1.Location = new Point (10, 20);
propertyGrid1.TabIndex = 1;
propertyGrid1.Text = "Property Grid";
propertyGrid1.Dock = DockStyle.Fill;
propertyGrid1.Font = new Font("URW Gothic L", 10.25f, GraphicsUnit.Point);
propertyGrid1.CategoryForeColor = SystemColors.ControlLight;
propertyGrid1.ViewForeColor = SystemColors.ControlText;
propertyGrid1.ViewBackColor = SystemColors.Control;
propertyGrid1.LineColor = SystemColors.ControlLight;
form1.Controls.Add (propertyGrid1);
form1.Show ();
win.RenderFrame += (sender, aaa) => { Application.DoEvents (); };
using(var system = (new System6.System6()).GetInstance (win))
{
//system.PropertyChanged += (sender, e) => propertyGrid1.Refresh();
propertyGrid1.SelectedObject = system;
win.Run ();
}
}
示例11: doQuery
public bool doQuery(PropertyGrid grid)
{
input = (Input)grid.SelectedObject; ;
this.res = amz.searchArtistList("anything","anything", input.Query, input.Field);
grid.SelectedObject = this.res;
return (this.res != null);
}
示例12: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.pgSettings = new System.Windows.Forms.PropertyGrid();
this.SuspendLayout();
//
// pgSettings
//
this.pgSettings.Dock = System.Windows.Forms.DockStyle.Fill;
this.pgSettings.LineColor = System.Drawing.SystemColors.ScrollBar;
this.pgSettings.Location = new System.Drawing.Point(0, 0);
this.pgSettings.Name = "pgSettings";
this.pgSettings.Size = new System.Drawing.Size(300, 237);
this.pgSettings.TabIndex = 0;
this.pgSettings.ToolbarVisible = false;
//
// EditSettings
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(300, 237);
this.Controls.Add(this.pgSettings);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Name = "EditSettings";
this.Opacity = 0.97D;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Edit Settings";
this.ResumeLayout(false);
}
示例13: AttachShrinkerEventHandler
/// <summary>
/// Attaches the <see cref="ShrinkerEventHandler"/> to a <see cref="PropertyGrid"/>.
/// </summary>
/// <param name="pg">The <see cref="PropertyGrid"/> to attach the event to.</param>
public static void AttachShrinkerEventHandler(PropertyGrid pg)
{
if (pg == null)
return;
pg.SelectedObjectsChanged += ShrinkerEventHandler;
}
示例14: CategoryGridEntry
public CategoryGridEntry(PropertyGrid ownerGrid, GridEntry peParent,string name, GridEntry[] childGridEntries)
: base(ownerGrid, peParent) {
this.name = name;
#if DEBUG
for (int n = 0;n < childGridEntries.Length; n++) {
Debug.Assert(childGridEntries[n] != null, "Null item in category subproperty list");
}
#endif
if (categoryStates == null) {
categoryStates = new Hashtable();
}
lock (categoryStates) {
if (!categoryStates.ContainsKey(name)) {
categoryStates.Add(name, true);
}
}
this.IsExpandable = true;
for (int i = 0; i < childGridEntries.Length; i++) {
childGridEntries[i].ParentGridEntry = this;
}
this.ChildCollection = new GridEntryCollection(this, childGridEntries);
lock (categoryStates) {
this.InternalExpanded = (bool)categoryStates[name];
}
this.SetFlag(GridEntry.FLAG_LABEL_BOLD,true);
}
示例15: PropertyGridManager
public PropertyGridManager(PropertyGrid propertyGrid, RuntimeOptions runtimeOptions)
{
mRuntimeOptions = runtimeOptions;
propertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(OnPropertyValueChanged);
mNosDisplayer.DisplayMode = NamedObjectPropertyGridDisplayer.DisplayModes.VariablesOnly;
mPropertyGrid = propertyGrid;
}