MaskedTextBox Control in C#.Net

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// mask is specify that you can enter only number
maskedTextBox1.Mask = "000000000000000";
}
private void button1_Click(object sender, EventArgs e)
{
label1.Text = "You entered " + maskedTextBox1.Text;
}
}
}
private void frmMaskedTextBox_Load(object sender, EventArgs e)
{
//change backcolor of maskedTextBox
maskedTextBox1.BackColor = Color.CadetBlue;

}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
.Net Developer

.Net Developer

I’m a professional Technical writer and Software Development with more than 5 years of experience.