R
Ron
I have a situation where I need to test if a Control implements from a
specific Interface to avoid an invalid cast exception:
foreach (Control ctrl in this.Controls)
{
// Need to test to see if ctrl inherits interface ICustomControl here
ICustomControl control = (ICustomControl)ctrl;
}
Thanks!
Ron
specific Interface to avoid an invalid cast exception:
foreach (Control ctrl in this.Controls)
{
// Need to test to see if ctrl inherits interface ICustomControl here
ICustomControl control = (ICustomControl)ctrl;
}
Thanks!
Ron