Class AuPropertyGrid
- Namespace
- AetherUtils.Core.WinForms.Controls
- Assembly
- AetherUtils.Core.dll
Represents a custom PropertyGrid control with support for additional buttons on the ToolStrip of
the property grid. Each button can be added using the AddButton(string, ToolStripButton) method. When all buttons are added,
DrawButtons() can be called to add them to the control.
[UsedImplicitly]
public class AuPropertyGrid : PropertyGrid, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl, IComPropertyBrowser
- Inheritance
-
AuPropertyGrid
- Implements
- Inherited Members
- Extension Methods
Remarks
A button can be retrieved using GetButton(string); this allows you to add an event handler to the button.
Most
commonly, an OnClick event handler should be added to a button.
Constructors
AuPropertyGrid(bool)
Create a new property grid, specifying whether to hide the property page button by default.
public AuPropertyGrid(bool hidePropertyPageButton)
Parameters
hidePropertyPageButtonbool- Should the property page button be hidden?
AuPropertyGrid(IContainer)
Create a new property grid. The property page button is hidden by default.
public AuPropertyGrid(IContainer container)
Parameters
containerIContainer
AuPropertyGrid(IContainer, bool)
Create a new property grid, specifying whether to hide the property page button by default.
public AuPropertyGrid(IContainer container, bool hidePropertyPageButton)
Parameters
containerIContainerhidePropertyPageButtonbool
Methods
AddButton(string, ToolStripButton)
Add a new button to the property grid with the specified key.
[UsedImplicitly]
public bool AddButton(string key, ToolStripButton button)
Parameters
keystring- A unique key to identify the button.
buttonToolStripButton- The ToolStripButton to add.
Returns
- bool
trueif the button was added;falseotherwise.
Dispose(bool)
Disposes of the resources (other than memory) used by the PropertyGrid.
protected override void Dispose(bool disposing)
Parameters
disposingbool- true to release both managed and unmanaged resources; false to release only unmanaged resources.
DrawButtons()
Draw the custom buttons on the property grid. This method should be called after adding or
removing buttons from the property grid via AddButton(string, ToolStripButton) or RemoveButton(string).
[UsedImplicitly]
public void DrawButtons()
GetButton(string)
Get the button specified by the key.
[UsedImplicitly]
public ToolStripButton? GetButton(string key)
Parameters
keystring- The unique key of the button to get.
Returns
RemoveButton(string)
Remove the button specified by
key from the property grid.[UsedImplicitly]
public bool RemoveButton(string key)
Parameters
keystring- The unique key of the button to remove.
Returns
- bool
trueif the button was removed;falseotherwise.