title: How to override MaxLength, Mask, PromptChar properties of maskedTextBox
body: <p>I created a class that I called <a href="https://stackoverflow.com/a/27082606/4208024">MaskedHexTextBox</a> which inherits from MaskedTetxBox to make it accept only HEX values. Anyway, I need to do the following:</p>
  
  <ul>
  <li>Give PromptChar a default value of '0' in MaskedHexTextBox, and still be able to change it in the form design</li>
  <li>Give Mask a default value of "\0xAAAA", and still be able to change it in the form design as well</li>
  <li>Use Mask.Length as the default value of MaxLength, I need to use in some calcs, and if I change the Mask after I place the control on the form, I still get the correct Mask length</li>
  </ul>
  
  <p>In general, how can I set a default values for Mask and PromtChar, is there a specific event that I can use to give these properties default values once the control is placed on the form?</p>
  
  <p>I used the class constructor to do this:</p>
  
  <pre><code>    public MaskedHexTextBox()
      {
          Mask = "\\0xAAAA";
          PromptChar = '0';
          MaxLength = Mask.Replace("\\", string.Empty).Length;
      }
  </code></pre>
  
  <p>in the Form_load event, I still see that the value for MaxLength is 32767</p>
  
  <pre><code>    private void Form1_Load(object sender, EventArgs e)
      {
          MessageBox.Show(maskedHexTextBox1.MaxLength.ToString());
      }
  </code></pre>
  
  <p>Another issue, suppose that MaxLength was correct, how can I ensure that if the mask is changed from the form design that MaxLength is updated?</p>