Private Sub ValiDataButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ValiDataButton.Click
If NameTextBox.Text.Length <= 0 Then
ErrorProvider1.SetError(NameTextBox, "이름을 넣으세요.")
Else
ErrorProvider1.Clear()
End If
If Not IsNumeric(AgeTextBox.Text) Then
ErrorProvider1.SetError(AgeTextBox, "나이를 넣으세요.")
Else
ErrorProvider1.Clear()
End If
End Sub
Private Sub NameTextBox_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles NameTextBox.Validating
If NameTextBox.Text.Length <= 0 Then
ErrorProvider1.SetError(NameTextBox, "이름를 넣으세여.")
e.Cancel = True
Else
ErrorProvider1.Clear()
End If
End Sub
Private Sub AgeTextBox_Validating(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles AgeTextBox.Validating
If Not IsNumeric(AgeTextBox.Text) Then
ErrorProvider1.SetError(AgeTextBox, "나이를 넣으세요.")
e.Cancel = True
Else
ErrorProvider1.Clear()
End If
End Sub
End Class