VS2008 Form designer does not open form with generictypes<5db719de-f614-4b19-aed5-8c4d2e94b1ef@e6g20

A

andrew smith

Problem is with the designer...

// opens in designer
// (has reason not to (undefined))
public class BaseForm<T>: Form
{
}

// doesn't open in design (it should)
public class StringFormBase: BaseForm<String>
{
}

// opens in designer...
public class StringForm: StringFormBase
{
}

class 'A' disaster in design.
 
A

andrew smith

Here's how I get around this....

public class InfoPanel<T>: Form
{
private T m_data;
public T Data{
get{ return m_data; }
set{ m_data = value; }
}
... other common methods.
};

/// <summary>
/// These classes exists, as is, only because the designer (is retarded).
/// Designer doesn't work with children of genericized forms.
/// But does work with the grandchildren of same.
/// </summary>

public class DataHubIP: InfoPanel<DataHub> { };
public class CitationIP : InfoPanel<Citation> { };
public class CatalogIP : InfoPanel<Catalog> { };
public class MemberIP : InfoPanel<Member> { };
public class ConformIP : InfoPanel<Conform> { };
public class SchemataIP : InfoPanel<Schemata> { };

.....

Now, I can create/use the following forms in the designer...

public class DataHubInfoPanel: DataHubIP
{
....
}

....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top