Convert Subclass to Inherited Class

Posted by Dave on Stack Overflow See other posts from Stack Overflow or by Dave
Published on 2010-05-26T13:22:43Z Indexed on 2010/05/26 13:31 UTC
Read the original article Hit count: 289

I have a C# .NET 2.0 project A that has a form (TreeForm) that uses Tree objects.

I have a project B that has a class Oak that inherits Tree.

When I try to reference and use the TreeForm in project B with my Oak objects, it's looking for objects of type Tree.

I've tried casting the Oak objects to Tree, but I get the error "Cannot convert type Oak to Tree".

How can I use my Oak objects in the TreeForm from project A?

© Stack Overflow or respective owner

Related posts about c#

Related posts about visual-studio