PropertyGridControl Class
Definition
Provides a user interface for browsing the properties of an object.
Implements
Syntax
[ToolboxBitmap(typeof(PropertyGridControl), "Images.PropertyGridControl.Icon.bmp")]
public class PropertyGridControl : Control, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IPropertyGridControl
Remarks
PropertyGridControl control allows you to view and change the design-time properties and events of selected objects on the designed form by the FormDesignerControl.
The most important properties of the PropertyGrid are:
SelectedObjects � gets or sets the currently selected objects.
PropertyBlacklist � gets or sets a list of property names excluded from the view.
Set FormDesignerControl property to specify the Form Designer control associated with the PropertyGrid control.
Examples
Here is how to declare a PropertyGridControl and handle its events from the C# code:
public partial class Form1 : Form
{
private void Form1_Load(object sender, EventArgs e)
{
var propertyGrid = new Alternet.FormDesigner.WinForms.PropertyGridControl();
propertyGrid.Dock = System.Windows.Forms.DockStyle.Fill;
propertyGrid.FormDesignerControl = designer;
propertyGrid.PreFilterProperties += PropertyGridControl_PreFilterProperties;
}
private void PropertyGridControl_PreFilterProperties(object sender, Alternet.FormDesigner.WinForms.PropertyGrid.PreFilterPropertiesEventArgs e)
{
if (e.Property.Name.StartsWith("Auto"))
{
e.IsExcluded = true;
}
}
}
Here is how to declare a PropertyGridControl and handle its events from the Visual Basic code:
Partial Public Class Form1
Inherits Form
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim propertyGrid = New Alternet.FormDesigner.WinForms.PropertyGridControl()
propertyGrid.Dock = System.Windows.Forms.DockStyle.Fill
propertyGrid.FormDesignerControl = designer
AddHandler propertyGrid.PreFilterProperties, AddressOf PropertyGridControl_PreFilterProperties
End Sub
Private Sub PropertyGridControl_PreFilterProperties(ByVal sender As Object, ByVal e As Alternet.FormDesigner.WinForms.PropertyGrid.PreFilterPropertiesEventArgs)
If e.[Property].Name.StartsWith("Auto") Then
e.IsExcluded = True
End If
End Sub
End Class
Constructors
PropertyGridControl() | Initializes a new instance of the |
Properties
ControlListVisible | |
FilterTextBoxVisible | |
FormDesignerControl | Gets or sets an |
LineColor | |
PropertyBlacklist | |
PropertyGrid | |
SelectedObjects |
Methods
ApplySelectedObjects() | |
OnHandleCreated(EventArgs) | |
OnLayout(LayoutEventArgs) |
Events
PreFilterProperties |