Question: ```
public T CreateForm<T>() where T: BaseForm, BaseMainForm

```

I know the above means where T is a `BaseForm` **and** a `BaseMainForm`. But is it also possible to make the constraint that T has to be either a `BaseForm` **or** a `BaseMainForm`?

Answer: 
No, that is not allowed in C#. The compiler uses the generic constraint to determine what operations is available on `T` within the generic method - so allowing an *or* expression would not be type safe.

If you need this, consider adding an interface covering the common parts of `BaseForm` and `BaseMainForm`, and apply that as the generic constraint. This way, the interface defines the contract of what the method `CreateForm<T>` needs - and you must simply make sure that the Form's you pass in implement the interface.

Something like:

```
public interface IBaseForm 
{
    Foo();
}

class BaseForm : IBaseForm {}
class BaseMainForm : IBaseForm {}

public T CreateForm<T>() where T : IBaseForm

```
It's not possible.

Consider adding either an interface or a base class, have both of those classes implement it, and use that as the type constraint.