M
Mac via DotNetMonster.com
Hi all,
I have a creating a my own tabpage class (MyTabPage) which inherits the .Net
TabPage class.
In the relevant event I want to loop through the collection of TabPages and
then when I find the TabPage I am after I want to cast this to MyTabPage so
that I can access the properties that I have added to this class.
When I try to do this I get an "invalid cast" error at runtime. Am I not able
to cast from a baseclass to a derived class? Is there a general rule of thumb?
regards,
Mac
I have a creating a my own tabpage class (MyTabPage) which inherits the .Net
TabPage class.
In the relevant event I want to loop through the collection of TabPages and
then when I find the TabPage I am after I want to cast this to MyTabPage so
that I can access the properties that I have added to this class.
When I try to do this I get an "invalid cast" error at runtime. Am I not able
to cast from a baseclass to a derived class? Is there a general rule of thumb?
regards,
Mac