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. Need help wif toggling check box

Need help wif toggling check box

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

    Hi, How do i toggle a checkbox? if lets say i want it to be FALSE initially...the moment i click on it...i want it to be TRUE, and so on...how do i do that?? Also, how do i get the state of the check box? Thanks 4 ur help!!

    A P 2 Replies Last reply
    0
    • F fynox

      Hi, How do i toggle a checkbox? if lets say i want it to be FALSE initially...the moment i click on it...i want it to be TRUE, and so on...how do i do that?? Also, how do i get the state of the check box? Thanks 4 ur help!!

      A Offline
      A Offline
      Anand Paranjpe
      wrote on last edited by
      #2

      checkbox is button with style as BS_CHECKBOX Use GetState() and SetState() of CButton class. The chosen One :)

      1 Reply Last reply
      0
      • F fynox

        Hi, How do i toggle a checkbox? if lets say i want it to be FALSE initially...the moment i click on it...i want it to be TRUE, and so on...how do i do that?? Also, how do i get the state of the check box? Thanks 4 ur help!!

        P Offline
        P Offline
        peterchen
        wrote on last edited by
        #3

        If you give it the BS_AUTOCHECKBOX style, it toggles automatically when you click. otherwise, as already said, it's internally a BUTTON class, you can query and change the check state with BM_SETCHECK and BM_GETCHECK (or CButton::SetCheck, GetCheck)


        "Vierteile den, der sie Hure schimpft mit einem türkischen Säbel."
        sighist | Agile Programming | doxygen

        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