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. reset dialog box

reset dialog box

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 5 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.
  • U Offline
    U Offline
    User 2070738
    wrote on last edited by
    #1

    I want to have a reset button on my dialog box which restore the control values to their original values.Any clue which function shud I call in the reset button function??

    A M B D 4 Replies Last reply
    0
    • U User 2070738

      I want to have a reset button on my dialog box which restore the control values to their original values.Any clue which function shud I call in the reset button function??

      A Offline
      A Offline
      aarontan
      wrote on last edited by
      #2

      I usually keep the default values in a config file..then read in from the file and update to the control values. Not sure if this is the best method. Aaron :doh:

      1 Reply Last reply
      0
      • U User 2070738

        I want to have a reset button on my dialog box which restore the control values to their original values.Any clue which function shud I call in the reset button function??

        M Offline
        M Offline
        Marc Soleda
        wrote on last edited by
        #3

        I'd store the default values in an XML file that you'd load at the beginning and then you'll have to reset each component one by one. The best automated thing you can do is to group all the edit box to have their resource id consequtive so the you'll be able to do in case you want to reset them: for(int i = iFirstResId; i <= iLastResId; i++) SetDlgItemText(i, ""); Marc Soleda. ... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.

        1 Reply Last reply
        0
        • U User 2070738

          I want to have a reset button on my dialog box which restore the control values to their original values.Any clue which function shud I call in the reset button function??

          B Offline
          B Offline
          BlackDice
          wrote on last edited by
          #4

          Or use the UpdateData function sending in the right parameter (I can never remember if it's TRUE or FALSE). As long as you haven't called it yet to update the variables, calling it with the right parameter will put whatever the variables' value are back in the controls My articles www.stillwaterexpress.com BlackDice

          1 Reply Last reply
          0
          • U User 2070738

            I want to have a reset button on my dialog box which restore the control values to their original values.Any clue which function shud I call in the reset button function??

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

            If you've designed it properly, my suggestion would be to simply click the Cancel button and then open the dialog up again. All of the initial (default) values will be present at that point and you will not have had to resort to some "reset" button.


            "One must learn from the bite of the fire to leave it alone." - Native American Proverb

            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