Sunday, 8 May 2011

Masked Textbox in C#

Masked Textbox
   Sets the string governing the input allowed for this control.  Masked TextBox is intelligent user control enhances the function of the TextBox control, which can mask the Date, IP Address, SSN, Phone numbers, digits, decimal and checks the validation, and automatically set the delimiter location.

    The property Masked is set to None by default and the control works like a normal TextBox control. If setting the property to Date Only, the control is masked to Date format.
 Like shown in below Image:
                                 


                               
Code for Ok Button Click-

private void button1_Click(object sender, EventArgs e)
        {
            label2.Text = label2.Text + maskedTextBox1.Text;
        }

No comments:

Post a Comment