nemaroller Posted September 30, 2003 Posted September 30, 2003 I need to develop a SuperTabPage... And therefore, cannot use usercontrol, because I want to inherit from TabPage. So instead I am creating a class that inherits TabPage. But, I want to be able to visually layout the controls on the page. And the VS IDE won't grant that ability to me. So I have been trying to implement a Designer for the class, but unfortunately, TabPageDesigner is marked as private. Perhaps its my syntax (which because there are little examples of anywhere its god-awful).. Anyone have ideas, hints, suggestions... Imports System.Windows.Forms.Design Imports System.ComponentModel <Designer(System.Windows.Forms.Design.TabPageDesigner, System.ComponentModel.Design.IDesigner)> Public Class Class1 Inherits TabPage Private Sub InitializeComponent() End Sub End Class Quote
*Experts* Volte Posted September 30, 2003 *Experts* Posted September 30, 2003 You may be able to do something with the ParentControlDesigner class, but I'm sure you'll be able to make a designable tab control that easily. It will most likely be easier to design your controls on a form and then copy and paste the designer code into the TabControl. Quote
nemaroller Posted September 30, 2003 Author Posted September 30, 2003 Well, the requirement is to have a TabPage that can be reused elsewhere in the program, and since the existence of the TabPage depends on the user, I needed code to do something like: MyStandardTabControl.TabPages.Add(myCustomTabPage) But anyway, I created a usercontrol, and after it was visually laid out, simply changed Inherits Usercontrol to Inherits TabPage. Not elegant in the way I would of have liked, but I'm certainly not going to bother with the time involved to figure out how to implement a designer for it. Quote
*Gurus* divil Posted October 1, 2003 *Gurus* Posted October 1, 2003 If you want to apply the framework tabpage designer to your class, it doesn't matter that it's private - you can apply the attribute like this: Designer("System.Windows.Forms.Design.TabPageDesigner, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") 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.