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. using errorprovider control with C# form with checkboxes

using errorprovider control with C# form with checkboxes

Scheduled Pinned Locked Moved C#
csharptutorial
5 Posts 3 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.
  • J Offline
    J Offline
    johnnysmith1
    wrote on last edited by
    #1

    Hello, I want to use the errorprovider control with checkboxes I have on a form. I know with a textbox: you can use something like if (textbox.text = <=0) errorprovider.seterror(textbox,"you must enter data"); but with a checkbox am unsure of how to use thank you

    OriginalGriffO L 3 Replies Last reply
    0
    • J johnnysmith1

      Hello, I want to use the errorprovider control with checkboxes I have on a form. I know with a textbox: you can use something like if (textbox.text = <=0) errorprovider.seterror(textbox,"you must enter data"); but with a checkbox am unsure of how to use thank you

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Um, have you tried:

      errorProvider1.SetError(checkBox1,"Goodbye");

      Works for me?

      No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      1 Reply Last reply
      0
      • J johnnysmith1

        Hello, I want to use the errorprovider control with checkboxes I have on a form. I know with a textbox: you can use something like if (textbox.text = <=0) errorprovider.seterror(textbox,"you must enter data"); but with a checkbox am unsure of how to use thank you

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #3

        johnnysmith1 wrote:

        but with a checkbox am unsure of how to use

        That is dependent on the application of each checkbox.

        1 Reply Last reply
        0
        • J johnnysmith1

          Hello, I want to use the errorprovider control with checkboxes I have on a form. I know with a textbox: you can use something like if (textbox.text = <=0) errorprovider.seterror(textbox,"you must enter data"); but with a checkbox am unsure of how to use thank you

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          Thinking about it more, just what error are you going to show for a checkbox? "This checkbox must be checked?" or "This checkbox must not be checked?" Smacks of "Do not press this button" buttons to me. I suspect it would be better for your user if you disable the checkbox when it can't be changed, rather than tell him he did something wrong.

          No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          J 1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            Thinking about it more, just what error are you going to show for a checkbox? "This checkbox must be checked?" or "This checkbox must not be checked?" Smacks of "Do not press this button" buttons to me. I suspect it would be better for your user if you disable the checkbox when it can't be changed, rather than tell him he did something wrong.

            No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones

            J Offline
            J Offline
            johnnysmith1
            wrote on last edited by
            #5

            thank you- you are probaly right- thanks for help

            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