This topic explains how to configure the brush resources panel of the brush editor.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
When scrolling the properties list the property editors are constantly coming in and out of view. When a brush type property editor is coming into view the BrushResourcesLoading event is raised. You have the ability to customize the brush editor’s user interface in the event’s handler using the event arguments object of type BrushResourcesEventArgs. This arguments object also include a reference to the PropertyGridPropertyItem associated with the brush property coming into view.
As visible on the picture above the brush resources panel divides the brushes in two groups – "Local Brush Resources" and "System Brush Resources". You can customize the brush entries in these groups by either adding your own brush definitions and/or including the system brushes.
To include the system brushes you need to set the AutomaticallyIncludeSystemBrushResources boolean property to true and this will include all colors from the current Windows theme in the "System Brush Resources" group.
To add your own brushes to one of these two groups use the BrushResources property and add objects of type PropertyGridBrushResourceItem. This type contains all information related to the brush resource entry – the brush itself, the brush name, the brush group and a Tag property of type object used to store arbitrary information.
When the user selects a brush entry from the brush resources list a BrushResourceSelected event is raised. The event arguments object of this event provides the following properties:
PropertyItem – this property of type PropertyGridPropertyItem
is associated with the brush property whose brush has changed.
BrushResource – this property of type PropertyGridBrushResourceItem
comprises all information related to the selected brush entry.
The following topics provide additional information related to this topic.