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
  1. Home
  2. General Programming
  3. C#
  4. Difference between Validated and Validating

Difference between Validated and Validating

Scheduled Pinned Locked Moved C#
comquestion
9 Posts 4 Posters 0 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.
  • L Offline
    L Offline
    LimitedAtonement
    wrote on last edited by
    #1

    Dear Sirs, I can't figure out the difference between Control.Validated and Control.Validating. I see the difference is that one's called, then the other's called. Here is the code I found in Control:

    if (this.NotifyValidating())
    {
    return true;
    }
    if (bulkValidation || NativeWindow.WndProcShouldBeDebuggable)
    {
    this.NotifyValidated();
    }

    So it looks like Validating can cancel the Validated event's scheduled run by setting the Cancel field of the EventArgs, but is that the only difference? Of what use is that? Thanks.

    In Christ, Aaron Laws http://ProCure.com

    N C L 3 Replies Last reply
    0
    • L LimitedAtonement

      Dear Sirs, I can't figure out the difference between Control.Validated and Control.Validating. I see the difference is that one's called, then the other's called. Here is the code I found in Control:

      if (this.NotifyValidating())
      {
      return true;
      }
      if (bulkValidation || NativeWindow.WndProcShouldBeDebuggable)
      {
      this.NotifyValidated();
      }

      So it looks like Validating can cancel the Validated event's scheduled run by setting the Cancel field of the EventArgs, but is that the only difference? Of what use is that? Thanks.

      In Christ, Aaron Laws http://ProCure.com

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Rather than guessing what each event does why not take the time to actually read the documentation? control.validated[^] control.validating[^]


      I know the language. I've read a book. - _Madmatt

      L 1 Reply Last reply
      0
      • L LimitedAtonement

        Dear Sirs, I can't figure out the difference between Control.Validated and Control.Validating. I see the difference is that one's called, then the other's called. Here is the code I found in Control:

        if (this.NotifyValidating())
        {
        return true;
        }
        if (bulkValidation || NativeWindow.WndProcShouldBeDebuggable)
        {
        this.NotifyValidated();
        }

        So it looks like Validating can cancel the Validated event's scheduled run by setting the Cancel field of the EventArgs, but is that the only difference? Of what use is that? Thanks.

        In Christ, Aaron Laws http://ProCure.com

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        Well, if you think about what the words mean, validating can be cancelled as it's called during the validation process. Validated is called after.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        1 Reply Last reply
        0
        • N Not Active

          Rather than guessing what each event does why not take the time to actually read the documentation? control.validated[^] control.validating[^]


          I know the language. I've read a book. - _Madmatt

          L Offline
          L Offline
          LimitedAtonement
          wrote on last edited by
          #4

          Dear Mr. Nischalke, Yeah, I read that, I just can't figure out what the use might be.

          In Christ, Aaron Laws http://ProCure.com

          C N 2 Replies Last reply
          0
          • L LimitedAtonement

            Dear Mr. Nischalke, Yeah, I read that, I just can't figure out what the use might be.

            In Christ, Aaron Laws http://ProCure.com

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            It's painfully clear. When you validate, there's an event you can catch to do further validation and thus reject it. When it's been validated, there's an event so you can know if it passed or not.

            Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

            1 Reply Last reply
            0
            • L LimitedAtonement

              Dear Mr. Nischalke, Yeah, I read that, I just can't figure out what the use might be.

              In Christ, Aaron Laws http://ProCure.com

              N Offline
              N Offline
              Not Active
              wrote on last edited by
              #6

              You are going to have a very difficult time in this field if something so simple throws you off.


              I know the language. I've read a book. - _Madmatt

              L 1 Reply Last reply
              0
              • N Not Active

                You are going to have a very difficult time in this field if something so simple throws you off.


                I know the language. I've read a book. - _Madmatt

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                One must always be vigilent so as to not become too qualified ... :)

                L 1 Reply Last reply
                0
                • L LimitedAtonement

                  Dear Sirs, I can't figure out the difference between Control.Validated and Control.Validating. I see the difference is that one's called, then the other's called. Here is the code I found in Control:

                  if (this.NotifyValidating())
                  {
                  return true;
                  }
                  if (bulkValidation || NativeWindow.WndProcShouldBeDebuggable)
                  {
                  this.NotifyValidated();
                  }

                  So it looks like Validating can cancel the Validated event's scheduled run by setting the Cancel field of the EventArgs, but is that the only difference? Of what use is that? Thanks.

                  In Christ, Aaron Laws http://ProCure.com

                  L Offline
                  L Offline
                  LimitedAtonement
                  wrote on last edited by
                  #8

                  Dear Sirs, Thanks for your sharp responses. It didn't throw me off, but it seemed a bit redundant, that's all. The clarity is indeed blinding as to what happens, but the intent is still - to me - less than clear. I'm beginning to see why this might be necessary, but I still can't think of an example. A specific example could be great, if you please.

                  In Christ, Aaron Laws http://ProCure.com

                  1 Reply Last reply
                  0
                  • L Lost User

                    One must always be vigilent so as to not become too qualified ... :)

                    L Offline
                    L Offline
                    LimitedAtonement
                    wrote on last edited by
                    #9

                    HA! Who is in danger of being too qualified?

                    In Christ, Aaron Laws http://ProCure.com

                    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