컨트롤 값이 잘못되었을 때 오류 아이콘을 표시하려면?
protected void textBox1_Validating (object sender,
System.ComponentModel.CancelEventArgs e)
{
try
{
int x = Int32.Parse(textBox1.Text);
errorProvider1.SetError(textBox1, "");
}
catch (Exception e)
{
errorProvider1.SetError(textBox1, "Not an integer value.");
}
}'C#.NET' 카테고리의 다른 글
| Partial 클래스 (0) | 2010.03.10 |
|---|---|
| errorProvider을 이용한 에러체크하기 (0) | 2010.03.09 |
| openFileDialog로 텍스트파일 선택하기 (0) | 2010.03.06 |
| [MSDN]DataGridView 셀에서 컨트롤 호스팅 (0) | 2010.03.03 |
| [Interface]인터페이스가 구현되어져 있는지 확인해보기 (0) | 2010.03.03 |
| 초간단 숫자 앞에 0 채우기 (0) | 2010.02.25 |
| 초간단 DataGridView 사용법 (추가중…) (0) | 2010.02.22 |
| [.Resx 리소스 , Resources]리소스 액세스 (3) | 2010.02.10 |
| [Process]외부프로그램 실행 / 익스플로어실행 (0) | 2010.02.08 |
| 초간단 Custom Controls 만들기 (0) | 2010.02.05 |