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. radio buttons problem

radio buttons problem

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

    i tried the following but somehow the radio buttons do not work accordingly. UpdateData (TRUE); if(m_radio=0){ do this...} if(m_radio=1){ {do this...} if(m_radio=2){ {do this...} i have 3 radio buttons grouped together.

    S D 2 Replies Last reply
    0
    • C coda_x

      i tried the following but somehow the radio buttons do not work accordingly. UpdateData (TRUE); if(m_radio=0){ do this...} if(m_radio=1){ {do this...} if(m_radio=2){ {do this...} i have 3 radio buttons grouped together.

      S Offline
      S Offline
      Steve S
      wrote on last edited by
      #2

      I hope that your if (m_radio = 0) is a typo, and you've not forgotten that in C/C++ the test for equality is == ... Steve S

      1 Reply Last reply
      0
      • C coda_x

        i tried the following but somehow the radio buttons do not work accordingly. UpdateData (TRUE); if(m_radio=0){ do this...} if(m_radio=1){ {do this...} if(m_radio=2){ {do this...} i have 3 radio buttons grouped together.

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

        As Steve has already indicated, it looks as though you have mistakingly used the assignment operator in place of the equality operator. If you will get in the habit of putting constants on the left side of either operator, the compiler would have gladly complained about these statements. For example:

        if (0 = m_radio) // the compiler would have flagged this as erroneous


        A rich person is not the one who has the most, but the one that needs the least.

        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