# C1.WPF.C1MaskedTextBox

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_WPF_C1MaskedTextBox" data-uid="C1.WPF.C1MaskedTextBox" class="text-break">C1MaskedTextBox Class
</h1>
  <div class="markdown level0 summary"><p>Represents a control that uses a mask to prevent users from entering invalid data.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.threading.dispatcherobject">DispatcherObject</a></div>
    <div class="level2"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.dependencyobject">DependencyObject</a></div>
    <div class="level3"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.media.visual">Visual</a></div>
    <div class="level4"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.uielement">UIElement</a></div>
    <div class="level5"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.frameworkelement">FrameworkElement</a></div>
    <div class="level6"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.controls.control">Control</a></div>
    <div class="level7"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.controls.primitives.textboxbase">TextBoxBase</a></div>
    <div class="level8"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.controls.textbox">TextBox</a></div>
    <div class="level9"><span class="xref">C1TextBoxBase</span></div>
    <div class="level10"><span class="xref">C1MaskedTextBox</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.media.animation.ianimatable">IAnimatable</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.iframeworkinputelement">IFrameworkInputElement</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.iinputelement">IInputElement</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.isupportinitialize">ISupportInitialize</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.markup.iqueryambient">IQueryAmbient</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.markup.iaddchild">IAddChild</a></div>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged">INotifyPropertyChanged</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.WPF.html">C1.WPF</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.4.6.2.dll</h6>
  <h5 id="C1_WPF_C1MaskedTextBox_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class C1MaskedTextBox : C1TextBoxBase, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, INotifyPropertyChanged</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class C1MaskedTextBox
    Inherits C1TextBoxBase
    Implements IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, INotifyPropertyChanged</code></pre>
  </div>
  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox__ctor" data-uid="C1.WPF.C1MaskedTextBox.#ctor">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.-ctor.html#C1_WPF_C1MaskedTextBox__ctor">C1MaskedTextBox()</a>
        </td>
        <td class="markdown level1 summary"><p>Initializes a new instance of a <a class="xref" href="C1.WPF.C1MaskedTextBox.html">C1MaskedTextBox</a>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="fields">Fields
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_CultureProperty" data-uid="C1.WPF.C1MaskedTextBox.CultureProperty">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.CultureProperty.html">CultureProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.C1MaskedTextBox.Culture.html#C1_WPF_C1MaskedTextBox_Culture">Culture</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_MaskProperty" data-uid="C1.WPF.C1MaskedTextBox.MaskProperty">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.MaskProperty.html">MaskProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.C1MaskedTextBox.Mask.html#C1_WPF_C1MaskedTextBox_Mask">Mask</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_PromptCharProperty" data-uid="C1.WPF.C1MaskedTextBox.PromptCharProperty">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.PromptCharProperty.html">PromptCharProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.C1MaskedTextBox.PromptChar.html#C1_WPF_C1MaskedTextBox_PromptChar">PromptChar</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_ReplaceModeProperty" data-uid="C1.WPF.C1MaskedTextBox.ReplaceModeProperty">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.ReplaceModeProperty.html">ReplaceModeProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.C1MaskedTextBox.ReplaceMode.html#C1_WPF_C1MaskedTextBox_ReplaceMode">ReplaceMode</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_TextMaskFormatProperty" data-uid="C1.WPF.C1MaskedTextBox.TextMaskFormatProperty">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.TextMaskFormatProperty.html">TextMaskFormatProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.C1MaskedTextBox.TextMaskFormat.html#C1_WPF_C1MaskedTextBox_TextMaskFormat">TextMaskFormat</a> dependency property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_ValueProperty" data-uid="C1.WPF.C1MaskedTextBox.ValueProperty">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.ValueProperty.html">ValueProperty</a>
        </td>
        <td class="markdown level1 summary"><p>Identifies the <a class="xref" href="C1.WPF.C1MaskedTextBox.Value.html#C1_WPF_C1MaskedTextBox_Value">Value</a> dependency property.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_Culture" data-uid="C1.WPF.C1MaskedTextBox.Culture">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.Culture.html#C1_WPF_C1MaskedTextBox_Culture">Culture</a>
        </td>
        <td class="markdown level1 summary"><p>Sets the culture used to display the value in the <a class="xref" href="C1.WPF.C1MaskedTextBox.html">C1MaskedTextBox</a>.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_IsValid" data-uid="C1.WPF.C1MaskedTextBox.IsValid">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.IsValid.html#C1_WPF_C1MaskedTextBox_IsValid">IsValid</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value that determines whether the control contains a valid entry.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_IsWatermarked" data-uid="C1.WPF.C1MaskedTextBox.IsWatermarked">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.IsWatermarked.html#C1_WPF_C1MaskedTextBox_IsWatermarked">IsWatermarked</a>
        </td>
        <td class="markdown level1 summary"><p>Gets a value indicating whether this textbox is watermarked.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_Mask" data-uid="C1.WPF.C1MaskedTextBox.Mask">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.Mask.html#C1_WPF_C1MaskedTextBox_Mask">Mask</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the input mask.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_PromptChar" data-uid="C1.WPF.C1MaskedTextBox.PromptChar">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.PromptChar.html#C1_WPF_C1MaskedTextBox_PromptChar">PromptChar</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the character used to show spaces where user is supposed to type.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_ReplaceMode" data-uid="C1.WPF.C1MaskedTextBox.ReplaceMode">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.ReplaceMode.html#C1_WPF_C1MaskedTextBox_ReplaceMode">ReplaceMode</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value indicating whether new characters will be inserted or replace existing ones while you are typing.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_TextMaskFormat" data-uid="C1.WPF.C1MaskedTextBox.TextMaskFormat">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.TextMaskFormat.html#C1_WPF_C1MaskedTextBox_TextMaskFormat">TextMaskFormat</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a value that determines whether literals and prompt characters are included in the <a class="xref" href="C1.WPF.C1MaskedTextBox.Value.html#C1_WPF_C1MaskedTextBox_Value">Value</a> property.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_Value" data-uid="C1.WPF.C1MaskedTextBox.Value">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.Value.html#C1_WPF_C1MaskedTextBox_Value">Value</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the formatted content of the control as specified by the <a class="xref" href="C1.WPF.C1MaskedTextBox.TextMaskFormat.html#C1_WPF_C1MaskedTextBox_TextMaskFormat">TextMaskFormat</a> property.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_OnApplyTemplate" data-uid="C1.WPF.C1MaskedTextBox.OnApplyTemplate">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.OnApplyTemplate.html#C1_WPF_C1MaskedTextBox_OnApplyTemplate">OnApplyTemplate()</a>
        </td>
        <td class="markdown level1 summary"><p>Builds the visual tree for the <span class="xref">C1.WPF.C1TextBoxBase</span> control when a new template is applied.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_OnMaskedTextChanged_C1_WPF_MaskedTextChangedEventArgs_" data-uid="C1.WPF.C1MaskedTextBox.OnMaskedTextChanged(C1.WPF.MaskedTextChangedEventArgs)">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.OnMaskedTextChanged.html#C1_WPF_C1MaskedTextBox_OnMaskedTextChanged_C1_WPF_MaskedTextChangedEventArgs_">OnMaskedTextChanged(MaskedTextChangedEventArgs)</a>
        </td>
        <td class="markdown level1 summary"><p>Occurs when consistent content that conforms to the <a class="xref" href="C1.WPF.C1MaskedTextBox.Mask.html#C1_WPF_C1MaskedTextBox_Mask">Mask</a> changes in the text box.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_UpdateValue" data-uid="C1.WPF.C1MaskedTextBox.UpdateValue">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.UpdateValue.html#C1_WPF_C1MaskedTextBox_UpdateValue">UpdateValue()</a>
        </td>
        <td class="markdown level1 summary"><p>For Silverlight version of the control, forces <a class="xref" href="C1.WPF.C1MaskedTextBox.html">C1MaskedTextBox</a> to update its
<a class="xref" href="C1.WPF.C1MaskedTextBox.Value.html#C1_WPF_C1MaskedTextBox_Value">Value</a> and Text properties when the control is not loaded.
Does nothing in WPF.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="events">Events
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_C1MaskedTextBox_MaskedTextChanged" data-uid="C1.WPF.C1MaskedTextBox.MaskedTextChanged">
          <a class="xref" href="C1.WPF.C1MaskedTextBox.MaskedTextChanged.html">MaskedTextChanged</a>
        </td>
        <td class="markdown level1 summary"><p>Occurs when consistent content that conforms to the <a class="xref" href="C1.WPF.C1MaskedTextBox.Mask.html#C1_WPF_C1MaskedTextBox_Mask">Mask</a> changes in the text box.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="extensionmethods">Extension Methods</h3>
  <div>
      <a class="xref" href="C1.WPF.Extensions.FindParent.html#C1_WPF_Extensions_FindParent__1_System_Windows_FrameworkElement_">Extensions.FindParent&lt;T&gt;(FrameworkElement)</a>
  </div>
  <div>
      <a class="xref" href="C1.WPF.Extensions.GetAllParents.html#C1_WPF_Extensions_GetAllParents_System_Windows_FrameworkElement_">Extensions.GetAllParents(FrameworkElement)</a>
  </div>
  <div>
      <a class="xref" href="C1.WPF.Extensions.GetVisualStateGroup.html#C1_WPF_Extensions_GetVisualStateGroup_System_Windows_FrameworkElement_System_String_">Extensions.GetVisualStateGroup(FrameworkElement, string)</a>
  </div>
  <div>
      <a class="xref" href="C1.WPF.Extensions.SetBinding.html#C1_WPF_Extensions_SetBinding__1_System_Windows_FrameworkElement_System_Windows_DependencyProperty___0_System_Linq_Expressions_Expression_System_Func___0_System_Object___">Extensions.SetBinding&lt;T&gt;(FrameworkElement, DependencyProperty, T, Expression&lt;Func&lt;T, object&gt;&gt;)</a>
  </div>
  <div>
      <a class="xref" href="C1.WPF.Extensions.SetBinding.html#C1_WPF_Extensions_SetBinding__1_System_Windows_FrameworkElement_System_Windows_DependencyProperty___0_System_Linq_Expressions_Expression_System_Func___0_System_Object___System_Windows_Data_IValueConverter_">Extensions.SetBinding&lt;T&gt;(FrameworkElement, DependencyProperty, T, Expression&lt;Func&lt;T, object&gt;&gt;, IValueConverter)</a>
  </div>
  <div>
      <a class="xref" href="C1.WPF.Extensions.C1TransformToVisual.html#C1_WPF_Extensions_C1TransformToVisual_System_Windows_UIElement_System_Windows_UIElement_">Extensions.C1TransformToVisual(UIElement, UIElement)</a>
  </div>

</div>
