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. Going right to a subdialog

Going right to a subdialog

Scheduled Pinned Locked Moved C / C++ / MFC
csharpcomtutorialquestion
3 Posts 2 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.
  • J Offline
    J Offline
    Jason Hooper
    wrote on last edited by
    #1

    In certain situations I want to go right to a dialog after loading a dialog, and I'm wondering how to do this such that the parent dialog is drawn on screen first. For instance, I have dialog A with a button which, when clicked, loads another dialog B. In certain situations I want to pop up this child dialog B right away, as though the user clicked the button. If I set to true a member variable in dialog A, m_bPopupBRightAway, before calling DialogA::DoModal() and check this value at the end of DialogA::OnInitDialog(), dialog A isn't yet drawn on the screen when DialogB comes up. What's the best way to go about doing this so that I get the desired result? Thanks! - Jason (SonorkID 100.611) In the beginning, teachers taught the 5 W's: who, what, where, when, why. Now it's just a big damn G

    J 1 Reply Last reply
    0
    • J Jason Hooper

      In certain situations I want to go right to a dialog after loading a dialog, and I'm wondering how to do this such that the parent dialog is drawn on screen first. For instance, I have dialog A with a button which, when clicked, loads another dialog B. In certain situations I want to pop up this child dialog B right away, as though the user clicked the button. If I set to true a member variable in dialog A, m_bPopupBRightAway, before calling DialogA::DoModal() and check this value at the end of DialogA::OnInitDialog(), dialog A isn't yet drawn on the screen when DialogB comes up. What's the best way to go about doing this so that I get the desired result? Thanks! - Jason (SonorkID 100.611) In the beginning, teachers taught the 5 W's: who, what, where, when, why. Now it's just a big damn G

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      void CMyDlg::OnPaint()
      {
      if (IsIconic())
      {
      ...
      }
      else
      {
      CDialog::OnPaint();
      if(m_bFirstTime){
      m_bFirstTime=FALSE;
      ... // launch the second dialog.
      }
      }
      }

      Where m_bFirstTime is a member variable of the dialog initialized to TRUE. Another method, suggested by Shog9, is to self-post a user-defined message from OnInitDialog in response to which the second dialog is launched. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      J 1 Reply Last reply
      0
      • J Joaquin M Lopez Munoz

        void CMyDlg::OnPaint()
        {
        if (IsIconic())
        {
        ...
        }
        else
        {
        CDialog::OnPaint();
        if(m_bFirstTime){
        m_bFirstTime=FALSE;
        ... // launch the second dialog.
        }
        }
        }

        Where m_bFirstTime is a member variable of the dialog initialized to TRUE. Another method, suggested by Shog9, is to self-post a user-defined message from OnInitDialog in response to which the second dialog is launched. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

        J Offline
        J Offline
        Jason Hooper
        wrote on last edited by
        #3

        Joaquín M López Muñoz wrote: Another method, suggested by Shog9, is to self-post a user-defined message from OnInitDialog in response to which the second dialog is launched. Ooh, I like it. Thanks a lot! - Jason (SonorkID 100.611) In the beginning, teachers taught the 5 W's: who, what, where, when, why. Now it's just a big damn G

        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