Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted

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.

Posted

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.

  • *Gurus*
Posted

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")

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...