Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Custom Designer and Verbs
 

Custom Designer and Verbs

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
MigrationUser 1  Thursday, April 14, 2005 2:10 PM
You may be able to spot the difference between your your implementation and that of the customised Tab Control on my site.

<a href="http://dotnetrix.co.uk/tabcontrols.html">http://dotnetrix.co.uk/tabcontrols.html</a> -->Tabcontrol using custom tabpages.
MigrationUser 1  Friday, April 15, 2005 5:27 AM

You can use google to search for other answers

Custom Search

More Threads

• How to use the designer with classes derived from UserControl?
• can't save collection in disgner
• How to create an object property for a custom UserControl?
• DataBinding listview
• abstract UserControl
• form designer compile error between 2003 & 2005
• default values for inherited control
• Binding TextBox's Text property to application settings and setting UseSystemPasswordChar to true
• Extender Provider
• Custom events not showing up under Properties/Events in Designer?