Basically, I added a custom event to my TreeView derivative. It is meant to replace the AfterSelected Event, which I disable, because I require a different Event handling mechanism for when people click on tree items.
The event handling itself works well. But I want my new event to be the one wired when a custom control is doubled-clicked in the design view.
The custom class is called CustomTreeView, and this is how it declares its new event.
public event EventHandler CustomSelect;
So basically, when double clicked in the design view, I want this to appear in the MyForm.Designer.cs
this.MyCustomTreeView.CustomSelect += new System.Windows.Forms.TreeViewEventHandler(this.MyCustomTreeView_CustomSelect);
And obviously, the MyCustomTreeView_CustomSelect() function should be added to MyForm.cs
so how do I set this up in my custom control?
You’re looking for the
DefaultEventAttribute