Hi Joe,
I do not know why you want to instantiate the abstract control in the
designer,
but the mechanism of the .net dose not allow you to do this.
However, I think you can put the abstract method of the abstract class into
an Interface,
Then your abstract base class can be concrete and can be instantiated.
Your other control can override the base class and the interface.
Hope this helps.
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| Content-Class: urn:content-classes:message
| From: "Joe Vrba" <jo******@comps ys.com>
| Sender: "Joe Vrba" <jo******@comps ys.com>
| Subject: Designer and abstract classes
| Date: Thu, 24 Jul 2003 13:04:50 -0700
| Lines: 18
| Message-ID: <13************ *************** *@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNSHtbcQZHd9lI IRbCFijTVTJp1PQ ==
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| Path: cpmsftngxa06.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1716 02
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| I'm building a family of components derived from
| UserControl. There's an abstract base class to ensure
| basic functionality and then numerous other controls
| derived from that.
|
| The problem is that I'd like to manipulate some of the
| derived controls using the VS.NET designer. However, when
| the base class is made abstract, I get the error "The
| designer must create an instance of type <...> but it
| cannot because the type is declared as abstract."
|
| Is there any way to allow the designer to instantiate the
| abstract base class so I can work on the first tier
| derived components visually? (Second tier components,
| i.e. those derived from classes derived from the base
| class work fine.)
|
| Any suggestions would be appreciated.
|