class Parent
{
public int GetNo()
{
return 1;
}
}
class Child : Parent
{
public Child()
{
}
public int GetNo()
{
You can force this with an explicit cast e.g.
((Child)p).GetNo();
Or you can use hiding e.g.
public new int GetNo()
{
return 2;
}
Though I think the latter only gets called if the variable is typed to the class that hides the method.
If you really need to override a method properly and it's from a compiled DLL consider getting in touch with the developers to see whether they can make the method virtual (and if not why) or if an open source project just get the source code and modify it yourself.