Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Canceling validation

Canceling validation

Scheduled Pinned Locked Moved C#
questionhelp
6 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hhrafn
    wrote on last edited by
    #1

    I have a form where a user inputs into a few fields and I validate them for correct format ect.. I do a e.Cancel = true; in my Validating event. I can put a e.Cancel = false; into my FormClosing event to get it to close with out prompting for correction in my fields. my problem is that I can't get a "close" button to do the same as the close (top right X) on my form. How do I set the "e.Close" to false or essentially the samt for my form in whole? Thanks, H

    K L E 3 Replies Last reply
    0
    • H hhrafn

      I have a form where a user inputs into a few fields and I validate them for correct format ect.. I do a e.Cancel = true; in my Validating event. I can put a e.Cancel = false; into my FormClosing event to get it to close with out prompting for correction in my fields. my problem is that I can't get a "close" button to do the same as the close (top right X) on my form. How do I set the "e.Close" to false or essentially the samt for my form in whole? Thanks, H

      K Offline
      K Offline
      Kodanda Pani
      wrote on last edited by
      #2

      Hi hhrafn, Do you want to close the form or not? Whats your requirement? Thanks SGS

      H 1 Reply Last reply
      0
      • H hhrafn

        I have a form where a user inputs into a few fields and I validate them for correct format ect.. I do a e.Cancel = true; in my Validating event. I can put a e.Cancel = false; into my FormClosing event to get it to close with out prompting for correction in my fields. my problem is that I can't get a "close" button to do the same as the close (top right X) on my form. How do I set the "e.Close" to false or essentially the samt for my form in whole? Thanks, H

        L Offline
        L Offline
        Luis Alonso Ramos
        wrote on last edited by
        #3

        Set the Button's CausesValidation property to false. -- LuisR


        Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

        H 1 Reply Last reply
        0
        • K Kodanda Pani

          Hi hhrafn, Do you want to close the form or not? Whats your requirement? Thanks SGS

          H Offline
          H Offline
          hhrafn
          wrote on last edited by
          #4

          I'd like the form to ignore the validation requirements and close the form. For now the e.cancel feature doesn't allow me to close a form via a close button. I can only close by hitting the X in the top right corner. Probalby because there I can access the event that supports this cancel feature and I can set it to false.

          1 Reply Last reply
          0
          • L Luis Alonso Ramos

            Set the Button's CausesValidation property to false. -- LuisR


            Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!

            H Offline
            H Offline
            hhrafn
            wrote on last edited by
            #5

            Cool! Thanks! works great :D love the little simple solutions :D

            1 Reply Last reply
            0
            • H hhrafn

              I have a form where a user inputs into a few fields and I validate them for correct format ect.. I do a e.Cancel = true; in my Validating event. I can put a e.Cancel = false; into my FormClosing event to get it to close with out prompting for correction in my fields. my problem is that I can't get a "close" button to do the same as the close (top right X) on my form. How do I set the "e.Close" to false or essentially the samt for my form in whole? Thanks, H

              E Offline
              E Offline
              edokt
              wrote on last edited by
              #6

              Hi I have un over problem. Wheni close the form with Top Right X it fire the validating event of the textbox. Did you change any property of the form, that it don't fire this event Help me please

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups