本文整理汇总了C#中System.Windows.Forms.PropertyGrid.Refresh方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyGrid.Refresh方法的具体用法?C# PropertyGrid.Refresh怎么用?C# PropertyGrid.Refresh使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.PropertyGrid
的用法示例。
在下文中一共展示了PropertyGrid.Refresh方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: monitor
public monitor(DynamicNode n)
{
//MessageBox.Show(n.Owner.ToString());
props = n.GetType().GetProperties();
this.Text = "Resource monitor - " + n.ToString();
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.ClientSize = new System.Drawing.Size(480, 640);
this.StartPosition = FormStartPosition.Manual;
//this.Location = new Point(this.Parent
// TABS
tc = new TabControl();
tc.Dock = DockStyle.Fill;
tp_props = new TabPage();
tc.Controls.AddRange(new Control[] { tp_props });
// Datagrid for properties
pg_props = new PropertyGrid();
pg_props.SelectedObject = n;
pg_props.Dock = DockStyle.Fill;
tp_props.Controls.Add(pg_props);
t = new Timer();
t.Interval = 100;
t.Tick += delegate(object sender, EventArgs e) { pg_props.Refresh(); };
t.Start();
this.Controls.Add(tc);
}
示例2: SetPropertyGridLabelWidth
public static void SetPropertyGridLabelWidth(PropertyGrid grid, int width)
{
Control gridView = GetControlOfNamedType(grid, "PropertyGridView");
Control docComment = GetControlOfNamedType(grid, "DocComment");
FieldInfo widthField = gridView.GetType().GetField("labelWidth", BindingFlags.Instance | BindingFlags.NonPublic);
widthField.SetValue(gridView, width);
grid.Refresh();
width = (int)widthField.GetValue(gridView);
FieldInfo heightField = docComment.GetType().GetField("height", BindingFlags.Instance | BindingFlags.NonPublic);
if (heightField != null)
{
int height = (int)heightField.GetValue(docComment);
Console.WriteLine("" + heightField);
}
}