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. Keeping the values in controls when closing and opening a Dialog

Keeping the values in controls when closing and opening a Dialog

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 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.
  • L Offline
    L Offline
    Luis E Cuadrado
    wrote on last edited by
    #1

    Hello everybody: I have a Dialog with a combo box. I supposed to pick a value from the combo box and then when I close the dialog and open the same dialog again, the value that I was selected before closing the dialog is gone. Is there a way of keeping those values when opening and closing a dialog? Any answer is more than welcome. Thanks and have a good day, Luis E. Cuadrado :0)

    M T 2 Replies Last reply
    0
    • L Luis E Cuadrado

      Hello everybody: I have a Dialog with a combo box. I supposed to pick a value from the combo box and then when I close the dialog and open the same dialog again, the value that I was selected before closing the dialog is gone. Is there a way of keeping those values when opening and closing a dialog? Any answer is more than welcome. Thanks and have a good day, Luis E. Cuadrado :0)

      M Offline
      M Offline
      mishgun
      wrote on last edited by
      #2

      maybe you should use GetCurSel before destructing CDialog object and SetCurSel after creating CDialog again? nobody is perfect

      1 Reply Last reply
      0
      • L Luis E Cuadrado

        Hello everybody: I have a Dialog with a combo box. I supposed to pick a value from the combo box and then when I close the dialog and open the same dialog again, the value that I was selected before closing the dialog is gone. Is there a way of keeping those values when opening and closing a dialog? Any answer is more than welcome. Thanks and have a good day, Luis E. Cuadrado :0)

        T Offline
        T Offline
        Tomasz Sowinski
        wrote on last edited by
        #3

        Are you using DDX_ routines in DoDataExchange, or rather you've done data transfer yourself? Tomasz Sowinski -- http://www.shooltz.com

        Never argue with an idiot, he'll bring you to his level and beat you with experience.

        L 1 Reply Last reply
        0
        • T Tomasz Sowinski

          Are you using DDX_ routines in DoDataExchange, or rather you've done data transfer yourself? Tomasz Sowinski -- http://www.shooltz.com

          Never argue with an idiot, he'll bring you to his level and beat you with experience.

          L Offline
          L Offline
          Luis E Cuadrado
          wrote on last edited by
          #4

          Hello: Thanks for the reply. DDX_routines? I think I heard about those but I don't think I'm using those in my application. I was going to do data transfer my self but looks like DDX_ routines is the best way, I guess. Is there any resource over the internet that I can find about DDX_routines? Thanks, Luis E. Cuadrado :0)

          T 1 Reply Last reply
          0
          • L Luis E Cuadrado

            Hello: Thanks for the reply. DDX_routines? I think I heard about those but I don't think I'm using those in my application. I was going to do data transfer my self but looks like DDX_ routines is the best way, I guess. Is there any resource over the internet that I can find about DDX_routines? Thanks, Luis E. Cuadrado :0)

            T Offline
            T Offline
            Tomasz Sowinski
            wrote on last edited by
            #5

            Ok, I'll try to keep it simple. Did you use ClassWizard to associate some variable with combo box? Or you're just calling Get/SetCurSel? Tomasz Sowinski -- http://www.shooltz.com

            Never argue with an idiot, he'll bring you to his level and beat you with experience.

            L 1 Reply Last reply
            0
            • T Tomasz Sowinski

              Ok, I'll try to keep it simple. Did you use ClassWizard to associate some variable with combo box? Or you're just calling Get/SetCurSel? Tomasz Sowinski -- http://www.shooltz.com

              Never argue with an idiot, he'll bring you to his level and beat you with experience.

              L Offline
              L Offline
              Luis E Cuadrado
              wrote on last edited by
              #6

              Yes, I used ClassWizard to add a variable to the ComboBox. With that variable I call GetCurSel(). Sorry if my questions sound kind of newbie. I'm starting with MFC not long ago :0). Thanks, Luis E. Cuadrado :0)

              T 1 Reply Last reply
              0
              • L Luis E Cuadrado

                Yes, I used ClassWizard to add a variable to the ComboBox. With that variable I call GetCurSel(). Sorry if my questions sound kind of newbie. I'm starting with MFC not long ago :0). Thanks, Luis E. Cuadrado :0)

                T Offline
                T Offline
                Tomasz Sowinski
                wrote on last edited by
                #7

                Luis E. Cuadrado wrote: With that variable I call GetCurSel(). Variable is 'control' (CComboBox) or 'value' (int)? Tomasz Sowinski -- http://www.shooltz.com

                Never argue with an idiot, he'll bring you to his level and beat you with experience.

                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