Hello everyone,
I have placed simple validation through ErrorProvider Class on my textBoxes
to check whether ther r empty or not
Error Provider Class check and catches the error but it doesn't stop saving
the record. For instance if I click on any other button on the form it
doesn't stop user from doing so. How can I stop or restrict user to stay in
the textbox prebenting any other button or option to be clicked as long as
there is a valid entry in the textbox.
Hope everyone can understand myu problem
Here is the code for ur reference.
Private Sub txtuId_Validating(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles txtuId.Validating
If txtuId.Text = String.Empty Then
ErrorProvider1.SetError(txtuId, "UserId cannot be left blank")
txtuId.Focus()
Me.ActiveControl = txtuId
e.Cancel = True
Else
ErrorProvider1.SetError(txtuId, String.Empty)
End If
End Sub
Waiting for Quick responce.
Abul Hasan