Question

I am searching a way to get the possible types for upcasting an object. For example: I have a control of type MyControl which inherits Control. Now, when the object of type MyControl is downcasted to Control is there a way to find out, if it is the top object-type or when now to get the type(s) in which it can be upcasted (in this case MyControl)? I want it upcast to MyControl (with Reflection) and get a Property with reflection. But I don't know MyControl at the place where I have to do this.

MyControl is implement Visible with new. Now when I call control.Visible = true it will call the Visible of Control but I have to call the Visible of MyControl.

Thanks for your help.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top