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. Hide and show dialogs

Hide and show dialogs

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
8 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.
  • A Offline
    A Offline
    AnithaSubramani
    wrote on last edited by
    #1

    Hi All, I have two dialogs(IDD_DIALOG,IDD_DIALOG1).How to hide and show these dialog.

    C _ 2 Replies Last reply
    0
    • A AnithaSubramani

      Hi All, I have two dialogs(IDD_DIALOG,IDD_DIALOG1).How to hide and show these dialog.

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      I assume you have modeless dialogs, in which case simply use ShowWindow[^]. If this doesn't answer your question, please give us more info about your problem.

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

      A 1 Reply Last reply
      0
      • A AnithaSubramani

        Hi All, I have two dialogs(IDD_DIALOG,IDD_DIALOG1).How to hide and show these dialog.

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

        ShowWindow

        «_Superman_»

        1 Reply Last reply
        0
        • C Code o mat

          I assume you have modeless dialogs, in which case simply use ShowWindow[^]. If this doesn't answer your question, please give us more info about your problem.

          > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

          A Offline
          A Offline
          AnithaSubramani
          wrote on last edited by
          #4

          I did like this.

          this->ShowWindow(SW_HIDE);
          CMyDlg *NU = new CMyDlg();
          NU->ShowWindow(SW_SHOWNORMAL);

          But it showing debug Assertion error.

          C D 2 Replies Last reply
          0
          • A AnithaSubramani

            I did like this.

            this->ShowWindow(SW_HIDE);
            CMyDlg *NU = new CMyDlg();
            NU->ShowWindow(SW_SHOWNORMAL);

            But it showing debug Assertion error.

            C Offline
            C Offline
            Code o mat
            wrote on last edited by
            #5

            I think you either need something like this:

            CMyDlg Dlg;
            Dlg.DoModal();

            or something like this:

            CMyDlg *Dlg = new CMyDlg();
            Dlg->Create(IDD_DIALOG, NULL);
            Dlg->ShowWindow(SW_SHOW);

            Of course you need to pay atention at deleting your dialog once you are done with it if you created it with new...

            > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

            A 1 Reply Last reply
            0
            • C Code o mat

              I think you either need something like this:

              CMyDlg Dlg;
              Dlg.DoModal();

              or something like this:

              CMyDlg *Dlg = new CMyDlg();
              Dlg->Create(IDD_DIALOG, NULL);
              Dlg->ShowWindow(SW_SHOW);

              Of course you need to pay atention at deleting your dialog once you are done with it if you created it with new...

              > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

              A Offline
              A Offline
              AnithaSubramani
              wrote on last edited by
              #6

              I dont need to create the dialog again. I need to show the hidden dialog. Pls help me....

              C 1 Reply Last reply
              0
              • A AnithaSubramani

                I dont need to create the dialog again. I need to show the hidden dialog. Pls help me....

                C Offline
                C Offline
                Code o mat
                wrote on last edited by
                #7

                Ok, to clear out misunderstandings, show me how you created your dialogs. If you created both dialogs then you need to call ShowWindow(SW_SHOW) or ShowWindow(SW_HIDE) on the instances of the classe you already created, not on a new instance.

                > The problem with computers is that they do what you tell them to do and not what you want them to do. < > Life: great graphics, but the gameplay sux. <

                1 Reply Last reply
                0
                • A AnithaSubramani

                  I did like this.

                  this->ShowWindow(SW_HIDE);
                  CMyDlg *NU = new CMyDlg();
                  NU->ShowWindow(SW_SHOWNORMAL);

                  But it showing debug Assertion error.

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

                  AnithaSubramani wrote:

                  But it showing debug Assertion error.

                  Don't keep us in suspense. What line of what file asserted?

                  "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                  "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

                  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