Basically, what I'm trying to do is as follows:

in one .vb ...
Friend Class frmBase(Of T)
Inherits System.Windows.Forms.Form

Dim m_Obj as T

...
End Class

in another .vb ...
Friend Class frmDerived1
Inherits frmBase(Of SomeConcreteType)

...
End Class

The code itself works, but s you might expect, I'm getting an error
when trying to open up the derived forms in the Designer in VS2005,
with a "base class X could not be loaded" message. Is there something I
should look for that might prevent it, or it just the fact that I'm
trying to use Generics like this?

Thanks for any help,
-Phil M

Re: creating a Form(Of T)... Is this insane? by Robbe

Robbe
Fri May 12 20:31:41 CDT 2006

The designer has all sorts of problems with visual inheritance.
It doesn't surprise me a bit that creating a generic
form would cause problems with the designer.

--
Robbe Morris - 2004-2006 Microsoft MVP C#
Earn money answering .NET questions
http://www.eggheadcafe.com/forums/merit.asp





<fuiru2000@yahoo.com> wrote in message
news:1147469869.485119.290910@y43g2000cwc.googlegroups.com...
> Basically, what I'm trying to do is as follows:
>
> in one .vb ...
> Friend Class frmBase(Of T)
> Inherits System.Windows.Forms.Form
>
> Dim m_Obj as T
>
> ...
> End Class
>
> in another .vb ...
> Friend Class frmDerived1
> Inherits frmBase(Of SomeConcreteType)
>
> ...
> End Class
>
> The code itself works, but s you might expect, I'm getting an error
> when trying to open up the derived forms in the Designer in VS2005,
> with a "base class X could not be loaded" message. Is there something I
> should look for that might prevent it, or it just the fact that I'm
> trying to use Generics like this?
>
> Thanks for any help,
> -Phil M
>



Re: creating a Form(Of T)... Is this insane? by Michael

Michael
Sat May 13 03:05:30 CDT 2006


"Robbe Morris [C# MVP]" <info@eggheadcafe.com> wrote in message
news:%236kD5xidGHA.2188@TK2MSFTNGP05.phx.gbl...
> The designer has all sorts of problems with visual inheritance.
> It doesn't surprise me a bit that creating a generic
> form would cause problems with the designer.
>
> --
> Robbe Morris - 2004-2006 Microsoft MVP C#
> Earn money answering .NET questions
> http://www.eggheadcafe.com/forums/merit.asp
>
>
>
>
>
> <fuiru2000@yahoo.com> wrote in message
> news:1147469869.485119.290910@y43g2000cwc.googlegroups.com...
>> Basically, what I'm trying to do is as follows:
>>
>> in one .vb ...
>> Friend Class frmBase(Of T)
>> Inherits System.Windows.Forms.Form
>>
>> Dim m_Obj as T
>>
>> ...
>> End Class
>>
>> in another .vb ...
>> Friend Class frmDerived1
>> Inherits frmBase(Of SomeConcreteType)
>>
>> ...
>> End Class
>>
>> The code itself works, but s you might expect, I'm getting an error
>> when trying to open up the derived forms in the Designer in VS2005,
>> with a "base class X could not be loaded" message. Is there something I
>> should look for that might prevent it, or it just the fact that I'm
>> trying to use Generics like this?
>>
>> Thanks for any help,
>> -Phil M
>>
>
>