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. How to get which Radio button is Checked?

How to get which Radio button is Checked?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
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.
  • F Offline
    F Offline
    Fresher16
    wrote on last edited by
    #1

    Hello Everyone, I have added 4 group Boxes on my Dialog based App and in Each Group there are 3 Radio Buttons. According to the user's Selection, i want to get the combination of radio Buttons and Function according to the selection? For Ex:- In one group Box there are 3 Radio Buttons say 600 DPI, 300 DPI and 150 DPI. and same in the other Group Box. Suppose if user has selected 300 DPI in one Group Box and 150 DPI in Other Group Box. Then i want to know how to get that user has selected so and so combination. I m using GetCheckedRadioButon(1stRadioID, LastRadioID) but m not getting anything from that? Please help me Out.

    _ D _ 3 Replies Last reply
    0
    • F Fresher16

      Hello Everyone, I have added 4 group Boxes on my Dialog based App and in Each Group there are 3 Radio Buttons. According to the user's Selection, i want to get the combination of radio Buttons and Function according to the selection? For Ex:- In one group Box there are 3 Radio Buttons say 600 DPI, 300 DPI and 150 DPI. and same in the other Group Box. Suppose if user has selected 300 DPI in one Group Box and 150 DPI in Other Group Box. Then i want to know how to get that user has selected so and so combination. I m using GetCheckedRadioButon(1stRadioID, LastRadioID) but m not getting anything from that? Please help me Out.

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

      Group boxes might be causing the issue. See here

      You talk about Being HUMAN. I have it in my name AnsHUMAN

      1 Reply Last reply
      0
      • F Fresher16

        Hello Everyone, I have added 4 group Boxes on my Dialog based App and in Each Group there are 3 Radio Buttons. According to the user's Selection, i want to get the combination of radio Buttons and Function according to the selection? For Ex:- In one group Box there are 3 Radio Buttons say 600 DPI, 300 DPI and 150 DPI. and same in the other Group Box. Suppose if user has selected 300 DPI in one Group Box and 150 DPI in Other Group Box. Then i want to know how to get that user has selected so and so combination. I m using GetCheckedRadioButon(1stRadioID, LastRadioID) but m not getting anything from that? Please help me Out.

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Do you have the WS_GROUP style set correctly? That style should be set only for the first radio button in the group.

        Anurag Kela wrote:

        I m using GetCheckedRadioButon(1stRadioID, LastRadioID) but m not getting anything from that?

        So it's returning 0?

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

        1 Reply Last reply
        0
        • F Fresher16

          Hello Everyone, I have added 4 group Boxes on my Dialog based App and in Each Group there are 3 Radio Buttons. According to the user's Selection, i want to get the combination of radio Buttons and Function according to the selection? For Ex:- In one group Box there are 3 Radio Buttons say 600 DPI, 300 DPI and 150 DPI. and same in the other Group Box. Suppose if user has selected 300 DPI in one Group Box and 150 DPI in Other Group Box. Then i want to know how to get that user has selected so and so combination. I m using GetCheckedRadioButon(1stRadioID, LastRadioID) but m not getting anything from that? Please help me Out.

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

          I'm assuming you're using an MFC based dialog application. If this assumption is right, read on. For the first radio button of each group, set its Group property to True. Right click on this radio button and select Add Variable and create an integer variable. The above step is only possible with a radio button whose Group property is set to True. To get the user selection, simply call UpdateData() and the integer variable will contain the 0-based index of the selected radio button.

          «_Superman_»  _I love work. It gives me something to do between weekends.

          _Microsoft MVP (Visual C++)

          Polymorphism in C

          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