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?
turn validation off when pressing X (Close)
Page 1 of 13 Replies - 292 Views - Last Post: 25 February 2012 - 09:47 AM
Replies To: turn validation off when pressing X (Close)
#2
Re: turn validation off when pressing X (Close)
Posted 25 February 2012 - 06:45 AM
you need to show us your code so that we can see which events you have used for this.
#3
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.
#4
Re: turn validation off when pressing X (Close)
Posted 25 February 2012 - 09:47 AM
this is related to your other question, am I right? I've posted an answer over there. Which will solve this problem also, if you do it like that.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|