I don't think you're going to find a simple change to achieve this.
The problem is that TabPage overrides the internal AssignParent() method to throw an error if the control is not parented in a TabControl,but as Inheritors we cannot do this as we don't have access to the AssignParent() method.
The only workaround that I can think of, is to wrap the Win32 SYSTABCONTROL32 class and have it use panels instead of TabPages. This is an awful lot of work though.
Here's a simple demonstration class which will give you a Designer for other controls (this class inherits Panel but could easily inherit any other Control).
using System.Windows.Forms;
using System.ComponentModel;
using System.ComponentModel.Design;
namespace DesignableControls
{
public class MyPanel : MyPanelBase
{
public MyPanel()
: base()
{
this.InitializeComponent();
}
private void InitializeComponent()
{
}
}
[Designer("System.Windows.Forms.Design.UserControlDocumentDesigner, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(IRootDesigner))]
public class MyPanelBase : Panel
{
}
}
Build this class and you will have a Panel which can be Designed as a standalone component. You can change Inheritance to GroupBox and you will have a Designable Groupbox. As soon as you change Inheritance to TabPage you get an error when you try to instantiate the Designer because the internal AssignParent() method requires that the control be parented by TabControl.
Mick Doherty
http://dotnetrix.co.uk