|
I noticed in the designer for the Tab control that they have written a few custom DesignerVerbs for it. They appear in the property window for the Tab, and one of them is “Add Tab� When I click the verb, a new tab is added to the Tab, and it is fully functional in the VS Designer, i.e. it is given a name (“TabPage1�, it is serialized into code correctly, and you can drag controls onto it and the VS Designer fully recognizes it as a container and uses it correctly, etc. I have written a custom designer for one of our controls, and I’ve written a few verbs for it. One of them is “Add Step� Similar to your “Add Tab� in that when the user clicks it, one of the things it does is to add a TabPage to a Tab that is already present on the Form that my custom designer is for. The verb works correctly in so far as the TabPage gets added correctly and shows up in the Tab in the Designer window. However, the VS Designer appears to be unaware of it, and won’t recognize it or let you view its Properties. Controls that you drag onto it are added instead to the underlying Form, and VS doesn’t serialize the TabPage into code at all. If you save and close the Form and re-open it in Design mode, the TabPage is gone. So I am wondering how MS got the Designer to recognize a control that’s added behind the scenes by a verb, as if it had been added normally using the built-in Windows Forms Designer behavior. If someone can point me toward a particular Attribute or class off the top of their head that can help me solve this, that would be great.
Greg greg@cds-am.net |