C#/C#200제

[C#] 19일차 - 138. MaskedTextBox

반나무 2021. 2. 19. 19:48

MaskedTextBox는 TextBox에 입력되는 형식을 제안할 수 있는 기능

 

 

기호 의미 기호 의미
0 숫자 9 숫자 혹은 공백
L 문자 ? 문자 혹은 공백
A 영문자 a 영문자 혹은 공백
. 소수점 , 천자리 자리 표시자
: 시간 구분자 / 날짜 구분자

마스크에 사용되는 기호와 의미


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace A138_MaskedTextBox
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string str;

            str = "입사일 : " + txtDate.Text + "\n";
            str += "우편번호 : " + txtPost.Text + "\n";
            str += "주소 : " + txtAddr.Text + "\n";
            str += "휴대폰번호 : " + txtPhone.Text + "\n";
            str += "주민등록번호 : " + txtId.Text + "\n";
            str += "이메일 : " + txtEmail.Text + "\n";

            MessageBox.Show(str, "개인정보");

        }
    }
}

반응형