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. Visual Basic
  4. validation by code

validation by code

Scheduled Pinned Locked Moved Visual Basic
helpcsharpcssvisual-studio
4 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.
  • S Offline
    S Offline
    snuffnit
    wrote on last edited by
    #1

    :confused:Hi I am writing a large program where I am using three text boxes. I am performing validation controls on these text boxes however there are some conditions Names of textboxes 1. x 2. y 3. z The conditions are 1. x , y , z should be numeric. 2. x and y can be blank ( x = “” , y = “”) at a time 3. z can never be blank, it should always have a numeric value. 4. if x has a value y cannot be blank and x should be non negative 5. if y has a value x cannot be blank and y should not be non negative. 6. if x and y have values y > x 7. z should be non negative A message box should pop up each time the user clicks a button with the appropriate error ( eg : x cannot be negative , or y cannot be greater than x , etc… ) Since I am actually dealing with cells in a data grid I cannot use any sort of validation controls. I need to perform the validation using code. I am using visual studio 2005 , Visual Basic Any sort of help will be gratefully appreciated. snuffnit

    C G N 3 Replies Last reply
    0
    • S snuffnit

      :confused:Hi I am writing a large program where I am using three text boxes. I am performing validation controls on these text boxes however there are some conditions Names of textboxes 1. x 2. y 3. z The conditions are 1. x , y , z should be numeric. 2. x and y can be blank ( x = “” , y = “”) at a time 3. z can never be blank, it should always have a numeric value. 4. if x has a value y cannot be blank and x should be non negative 5. if y has a value x cannot be blank and y should not be non negative. 6. if x and y have values y > x 7. z should be non negative A message box should pop up each time the user clicks a button with the appropriate error ( eg : x cannot be negative , or y cannot be greater than x , etc… ) Since I am actually dealing with cells in a data grid I cannot use any sort of validation controls. I need to perform the validation using code. I am using visual studio 2005 , Visual Basic Any sort of help will be gratefully appreciated. snuffnit

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

      Why is this text in bold ? It's quite annoying. I guess you need to check these rules in the click event for your button then.

      Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

      1 Reply Last reply
      0
      • S snuffnit

        :confused:Hi I am writing a large program where I am using three text boxes. I am performing validation controls on these text boxes however there are some conditions Names of textboxes 1. x 2. y 3. z The conditions are 1. x , y , z should be numeric. 2. x and y can be blank ( x = “” , y = “”) at a time 3. z can never be blank, it should always have a numeric value. 4. if x has a value y cannot be blank and x should be non negative 5. if y has a value x cannot be blank and y should not be non negative. 6. if x and y have values y > x 7. z should be non negative A message box should pop up each time the user clicks a button with the appropriate error ( eg : x cannot be negative , or y cannot be greater than x , etc… ) Since I am actually dealing with cells in a data grid I cannot use any sort of validation controls. I need to perform the validation using code. I am using visual studio 2005 , Visual Basic Any sort of help will be gratefully appreciated. snuffnit

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

        Welcome to the Code Project. Please don't post the same question all over the place.

        --- b { font-weight: normal; }

        1 Reply Last reply
        0
        • S snuffnit

          :confused:Hi I am writing a large program where I am using three text boxes. I am performing validation controls on these text boxes however there are some conditions Names of textboxes 1. x 2. y 3. z The conditions are 1. x , y , z should be numeric. 2. x and y can be blank ( x = “” , y = “”) at a time 3. z can never be blank, it should always have a numeric value. 4. if x has a value y cannot be blank and x should be non negative 5. if y has a value x cannot be blank and y should not be non negative. 6. if x and y have values y > x 7. z should be non negative A message box should pop up each time the user clicks a button with the appropriate error ( eg : x cannot be negative , or y cannot be greater than x , etc… ) Since I am actually dealing with cells in a data grid I cannot use any sort of validation controls. I need to perform the validation using code. I am using visual studio 2005 , Visual Basic Any sort of help will be gratefully appreciated. snuffnit

          N Offline
          N Offline
          Nouvand
          wrote on last edited by
          #4

          Design the logic according to your conditions. And make sure the conditions can fit the logic or you'll never go as you wish. If you can't create the simple logic of this, you are not better then 10 years old kid. Hint: Tree diagram method. I'm sorry.

          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