i have a customer control that inherit from the UserControl class and i have a datetimePicker inside this custom control
when i use the new Keyword to hide the inherited BorderStyle property and Create new property that used to change the border style of datetime rather than the custom control
at designe time the property work with success but after building the solution the property lose the value and reset to it’s default value
the code is :
[Browsable(true)]
[EditorBrowsable(EditorBrowsableState.Always)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
[Description("This Property Used To Change The Border Of The Inner Control")]
public new BorderStyle BorderStyle
{
get { return DateTimePicker.BorderStyle; }
set
{
DateTimePicker.BorderStyle = value;
}
}
Try it with different names hope this will hep you