Adding Property Editors
Go Up to Making Components Available at Design Time
The Object Inspector provides default editing for all types of properties. You can, however, provide an alternate editor for specific properties by writing and registering property editors. You can register property editors that apply only to the properties in the components you write, but you can also create editors that apply to all properties of a certain type.
At the simplest level, a property editor can operate in either or both of two ways: displaying and allowing the user to edit the current value as a text string, and displaying a dialog box that permits some other kind of editing. Depending on the property being edited, you might find it useful to provide either or both kinds.
Writing a property editor requires these steps:
- Deriving a property-editor class.
- Editting the property, either as text or as a whole.
- Specifying editor attributes.
- Registering the property editor.