3 Replies - 292 Views - Last Post: 25 February 2012 - 09:47 AM Rate Topic: -----

#1 ssaa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 08-January 09

turn validation off when pressing X (Close)

Posted 25 February 2012 - 06:31 AM

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?

Is This A Good Question/Topic? 0
  • +

Replies To: turn validation off when pressing X (Close)

#2 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 204
  • View blog
  • Posts: 823
  • Joined: 21-December 11

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.
Was This Post Helpful? 0
  • +
  • -

#3 ssaa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 08-January 09

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.
Was This Post Helpful? 0
  • +
  • -

#4 nK0de  Icon User is offline

  • Catch me As Exception
  • member icon

Reputation: 204
  • View blog
  • Posts: 823
  • Joined: 21-December 11

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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1