0

I have a simple generic method:

public T Show<T>() where T : Form
{
                //
}
           

The call works:
var form = Controller.Show();

But now I want to set either one form class or the other form class as type parameter depending on a variable:

Type t = isTestBig ? TestForm1 : TestForm2;
var form = Controller.Show<t>();

This does not work. What do I need to change to make this work? Thanks.

Alexander
  • 1
  • 2

0 Answers0