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 / C++ / MFC
  4. Check Boxes - Mutually Exclusive

Check Boxes - Mutually Exclusive

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
10 Posts 6 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.
  • A Offline
    A Offline
    Anandi VC
    wrote on last edited by
    #1

    How to make two check boxes mutually exclusive? Thanks in advance, Anandi VC

    _ I E CPalliniC 5 Replies Last reply
    0
    • A Anandi VC

      How to make two check boxes mutually exclusive? Thanks in advance, Anandi VC

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      You will have to handle it in code. In the check box click handler, check or uncheck the other. Or you should consider using radio buttons.

      «_Superman_»

      A 1 Reply Last reply
      0
      • _ _Superman_

        You will have to handle it in code. In the check box click handler, check or uncheck the other. Or you should consider using radio buttons.

        «_Superman_»

        A Offline
        A Offline
        Anandi VC
        wrote on last edited by
        #3

        Thank you.I am handling it in code. Anandi VC

        1 Reply Last reply
        0
        • A Anandi VC

          How to make two check boxes mutually exclusive? Thanks in advance, Anandi VC

          I Offline
          I Offline
          Iain Clarke Warrior Programmer
          wrote on last edited by
          #4

          Unless you have a REEEEEEEEEEEALLY good reason to make these checkboxes, your customers will thank you for making them radio buttons. The standard window controls look different for a reason - to give the user different expectations about how they work. And if your work is not about keeping users of the software happy [and therefore giving you money to buy food], why are you doing this? Iain.

          Codeproject MVP for C++, I can't believe it's for my lounge posts...

          1 Reply Last reply
          0
          • A Anandi VC

            How to make two check boxes mutually exclusive? Thanks in advance, Anandi VC

            E Offline
            E Offline
            Eytukan
            wrote on last edited by
            #5

            Anandi.VC wrote:

            How to make two check boxes mutually exclusive?

            Is that why Radio buttons where invented for??


            OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus Best wishes to Rexx[^]

            1 Reply Last reply
            0
            • A Anandi VC

              How to make two check boxes mutually exclusive? Thanks in advance, Anandi VC

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #6

              Tell them they are radio buttons. ;)

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              In testa che avete, signor di Ceprano?

              1 Reply Last reply
              0
              • A Anandi VC

                How to make two check boxes mutually exclusive? Thanks in advance, Anandi VC

                _ Offline
                _ Offline
                _Superman_
                wrote on last edited by
                #7

                Radio buttons can handle "one and only one" functionality. But mutually exclusive check boxes can handle "zero or one" functionality which is not possible with radio buttons. Microsoft also uses mutually exclusive check boxes in their products.

                «_Superman_»

                S 1 Reply Last reply
                0
                • _ _Superman_

                  Radio buttons can handle "one and only one" functionality. But mutually exclusive check boxes can handle "zero or one" functionality which is not possible with radio buttons. Microsoft also uses mutually exclusive check boxes in their products.

                  «_Superman_»

                  S Offline
                  S Offline
                  Shog9 0
                  wrote on last edited by
                  #8

                  «_Superman_» wrote:

                  But mutually exclusive check boxes can handle "zero or one" functionality which is not possible with radio buttons.

                  Uh, yeah, it is. You add another radio button, label it "none of the above", and give it the same meaning in your program that the somewhat-less-than-obvious fewer than the maximum number of checkable checkboxes are checked state would have had, should you have been mad enough to actually implement such an atrocity. Now you have a finite number of states, all of which are explicitly named, and all of which can be selected with a single click. Radio buttons - learn to love 'em.

                  _ 1 Reply Last reply
                  0
                  • S Shog9 0

                    «_Superman_» wrote:

                    But mutually exclusive check boxes can handle "zero or one" functionality which is not possible with radio buttons.

                    Uh, yeah, it is. You add another radio button, label it "none of the above", and give it the same meaning in your program that the somewhat-less-than-obvious fewer than the maximum number of checkable checkboxes are checked state would have had, should you have been mad enough to actually implement such an atrocity. Now you have a finite number of states, all of which are explicitly named, and all of which can be selected with a single click. Radio buttons - learn to love 'em.

                    _ Offline
                    _ Offline
                    _Superman_
                    wrote on last edited by
                    #9

                    Okay. In VC++ 6.0, take a look at the properties dialog of a button. You will see 2 check boxes for Icon and Bitmap. So if this is an atrocity, how better would it be to do it in that space with radio buttons? :cool:

                    «_Superman_»

                    S 1 Reply Last reply
                    0
                    • _ _Superman_

                      Okay. In VC++ 6.0, take a look at the properties dialog of a button. You will see 2 check boxes for Icon and Bitmap. So if this is an atrocity, how better would it be to do it in that space with radio buttons? :cool:

                      «_Superman_»

                      S Offline
                      S Offline
                      Shog9 0
                      wrote on last edited by
                      #10

                      Space constraints? Combo box!

                      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