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. validating question

validating question

Scheduled Pinned Locked Moved C#
helpdatabasequestion
3 Posts 2 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.
  • R Offline
    R Offline
    rzvme
    wrote on last edited by
    #1

    i have a disconected imviroment database application, and normaly i need some validation rules for the data-entry part. i am using the invalidate event to check if the data is in the correct format. the problem is i want to be able to close the form is the data is not in the correct format, but i am not able to because the control refuses to lose focus until the data is in the correct format. please help

    rzvme

    G 1 Reply Last reply
    0
    • R rzvme

      i have a disconected imviroment database application, and normaly i need some validation rules for the data-entry part. i am using the invalidate event to check if the data is in the correct format. the problem is i want to be able to close the form is the data is not in the correct format, but i am not able to because the control refuses to lose focus until the data is in the correct format. please help

      rzvme

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Your question really answers itself. ;) You have made the choise that the control should not lose focus until the format is correct. Therefore you can not escape from the control until the format is correct. The solution is of course that if you don't want the control to work that way, you change the control so that it doesn't work that way. Implement the validation on form level instead of on field level.

      --- Year happy = new Year(2007);

      R 1 Reply Last reply
      0
      • G Guffa

        Your question really answers itself. ;) You have made the choise that the control should not lose focus until the format is correct. Therefore you can not escape from the control until the format is correct. The solution is of course that if you don't want the control to work that way, you change the control so that it doesn't work that way. Implement the validation on form level instead of on field level.

        --- Year happy = new Year(2007);

        R Offline
        R Offline
        rzvme
        wrote on last edited by
        #3

        but can i at least find out if the form is trying to get the focus so it can close, or another control is trying to get the focus?

        rzvme

        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