
Originally Posted by
cdaq
Just get rid of new in the MaxLength property
Code:
public int MaxLength {
get {
return base.MaxLength;
}
}
This will hide the base classes implementation of MaxLength and will make your version read only.
I think 'new' would be preferred since it also hides the base implementation and prevents the warnings to use override or new.
Strangely enough, The ReadOnly attribute has to be set for the property in order for the designer not to attempt to assign a default value to the MaxLength which won't compile since there's only a 'get' accessor.
Code:
[ReadOnly(true)]
[Browsable(false)]
public new int MaxLength {
get {
return base.MaxLength;
}
}