I don't fully understand the purpose of C++ code you have provided, but if I
understand what you need, the answer is yes, you can store the Type of the
form and create it later.
By Type, I mean System.Type, and by creating, I mean creating an instance of
the specified Type with Activator.
your data structure would like as follows:
class Foo
{
public Type FormType;
}
void CreateAndShowFormFromFoo(Foo foo)
{
Form f = (Form)Activator.CreateInstance(foo.FormType);
f.Show();
}
"Ian Semmel" <is***********@NOKUNKrocketcomp.com.au> wrote in message
news:uu**************@TK2MSFTNGP05.phx.gbl...
In C++, I would typically have a static table of elements like
typedef struct CIconListBoxItem
{
LPCTSTR pszText;
UINT image;
UINT messageID;
bool bDisable;
CRuntimeClass* pView;
}CIconListBoxItem;
where pView is initialised to RUNTIME_CLASS(MyForm)
and will create the form with Createview
Is there an equivalent in C# whereby I can put the class of form I want in
a table and create it as needed ?