I have a form with numerous textboxes and I use the validating event to validate these items.
If I want to close that form with the X button in the upper right corner of that window validation may not occur.
For example a user is filling in data and he inputs something incorrect in a field, but he then quickly wants to close the window by pushing X in the upper right corner.
At the moment validation goes off and show a dialogbox that incorrect data is enterred when I press X.
How can I turn validation off when pressing X, so that the window closes immediately without validation?
Page 1 of 1
3 Replies - 292 Views - Last Post: 25 February 2012 - 09:47 AM
Replies To: turn validation off when pressing X (Close)
Re: turn validation off when pressing X (Close)
Posted 25 February 2012 - 09:46 AM
Private Sub Details1_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Details1.Leave MsgBox("Lost Focus") For Each It1 As Control In Me.Details1.Controls If (It1.Text = String.Empty) Then It1.Focus() End If Next End Sub
Here Details1 is the name of GroupBox.
i used Super Validator validation, Required Field Validator.
Page 1 of 1