Base windows form, that takes a generic type

OK, so I'm trying to create a base Windows Form that implements the Singleton design pattern. I'm doing this because I'm building an MDI based application and I don't want a child control/form to exist more than once at a time.

I created a SingletonWindowsForm that extended System.Windows.Forms.Form and had a static method for GetInstance. I extended that form from each of my child controls but kept having problems with types. So at that point I added a type to the SingletonWindowsForm so I could specify which type should come back from the GetInstance method. However, I couldn't do "new T();" per the compiler. :)

Does anyone have a clue as to how I can go about doing this properly



Answer this question

Base windows form, that takes a generic type