B-Dog,
Its "easier" to use the Validating event for TextBox, Validating is
inherited from Control, so all controls have a Validating event.
For details on the Validating event see:
http://msdn.microsoft.com/library/d...emwindowsformscontrolclassvalidatingtopic.asp
In your case you can use something like for all 8 text boxes:
Private Sub textBox1_Validating(ByVal sender As Object, _
ByVal e As System.ComponentModel.CancelEventArgs) Handles
textBox1.Validating
If textBox1.Text = "" Then
' Cancel the event and select the text to be corrected by the user.
e.Cancel = True
End If
End Sub
Alternatively you can have all 8 use one routine.
Private Sub textBox_Validating(ByVal sender As Object, _
ByVal e As System.ComponentModel.CancelEventArgs) Handles
textBox1.Validating, TextBox2.Validating, TextBox3.Validating,
TextBox4.Validating
Dim txt As TextBox = DirectCast(sender, TextBox)
If txt.Text = "" Then
' Cancel the event and select the text to be corrected by the user.
e.Cancel = True
End If
End Sub
Note the above link using the ErrorProvider control to display errors to the
user.
http://msdn.microsoft.com/library/d...SystemWindowsFormsErrorProviderClassTopic.asp
Hope this helps
Jay