Technically, by inheriting
TextBox
, you can shadow its
MaxLength
property with the
new
keyword:
public class CustomTextBox : TextBox
{
public new int MaxLength
{
get { }
}
}
If you do not provide any setter, the new property will be read-only.
But, as Paul stated in its solution, that is a terrible idea to try to stuff so much information in a single control.