문자열 취득 후 한글자씩. 특성 파악.

 

private void textBox1_Validating(object sender, CancelEventArgs e)
{
if (textBox1.Text == null || textBox1.Text == "") return;

string szBuff = textBox1.Text;
foreach (char cData in szBuff)
{
// 문자가 있는경우 false
if (Char.IsNumber(cData) == false)
{
MessageBox.Show("문자가 포함되어있습니다. .. " + szBuff);
return;
}
}
}

 

+ Recent posts