Since you have an instance Type, you need to use IsAssignableFrominstead is:
x => Type.GetType("MyFormName").IsAssignableFrom(x.GetType())
This, of course, assumes that you really cannot refer to the actual type at compile time. If you can, then you can simplify this code instead:
.OfType<MyFormName>().FirstOrDefault();
That will have something internally that resembles:
x is MyFormName
How the operator works is.
Servy source
share