Jarod Posted April 2, 2003 Posted April 2, 2003 I have created my own TabPage control, inheriting from the "standard" Windows.Forms.TabPage However, I would like to be able to choose it at design time when creating a TabControl. For exemple when we create a TableStyle at design time, the collection wizard offers us the possibility to choose between the TextBoxColumns and the BoolColumns Is there a way to do the same in my case? Is there any attribute that I have to use in that case ? Thanks, Quote Jarod
*Gurus* divil Posted April 2, 2003 *Gurus* Posted April 2, 2003 I guess you would have to inherit from TabControl, make a new TabPages collection based on your own page, and even use your own designer to specify that the verbs use your pages when creating new ones. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Jarod Posted April 3, 2003 Author Posted April 3, 2003 Ok and I have seen that the TabPage (the standard one as my custom one) doesn't appear in the ToolBox when I try to customize it. I think that this is normal as the TabPage can't be added in a container other than the TabControl. But one other nice solution to my previous problem is to be able to Drag / Drop my custom TabPage in a TabControl (instead of adding "normal" TabPages end changing the generated code. So is there a way to add a tabPage to the ToolBox ? Thanks Quote Jarod
a_jam_sandwich Posted April 3, 2003 Posted April 3, 2003 Tabpages like menu items are children classes to the main contorl TabContol and MainMenu\Context menu respectfuly So no, just change the creation of you tabpages to your class instead of the normal tabpage class in the form geration code so instead of Friend WithEvents TabPage1 As System.Windows.Forms.TabPage Me.TabPage1 = New System.Windows.Forms.TabPage() it becomes Friend WithEvents TabPage1 As UserTabPage Me.TabPage1 = New UserTabPage() remember UserTabPage is the class name of your inherited tabpage class. Andy Quote Code today gone tomorrow!
*Gurus* divil Posted April 3, 2003 *Gurus* Posted April 3, 2003 You could try appling a ToolBoxItem(True) attribute to your tabpage, then you might be able to persuade it to appear in the toolbox. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.