Can anyone explain the actual use of method hiding in C# with a valid example ?
If the method is defined using the new keyword in the d
One time when you would use them is when you need to add/modify an attribute that is on a base-class method. For example:
[Browsable(true)]
[EditorBrowsable(EditorBrowsableState.Always)]
public new event EventHandler TextChanged
{
add { base.TextChanged += value; }
remove { base.TextChanged -= value; }
}
The base Control class has a TextChanged event, but the base event has all kinds of attributes slapped on it to prevent it from showing up in intellisense or the designer. Because the class I used that in makes extensive use of both the Text property and the TextChanged event, I wanted the TextChanged event to show up in intellisense and be visible in the properties window.