You need to create custom "Verbs" for your Component or Control designer. This will make your verbs show up in the property browser and in the designer context menu.
The designer generates an event when the user selects a verb, and you can handle this event to perform a custom operation.
You do this by overriding the Verbs property in your Designer class.
Here is an example:
public class CustomControlExtDesigner : ControlDesigner
{
public override DesignerVerbCollection Verbs
{
get
{
if ( verbs == null )
{
verbs = new DesignerVerbCollection();
verbs.Add(
new DesignerVerb( "Add New Child", new EventHandler( OnAdd ) ) );
}
return verbs;
}
}
private void OnAdd( object sender, EventArgs e )
{
// Code to add a new child inside your control...
}
}
Contributed from George Shepherd's Windows Forms FAQ