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. Show information in the same dialog after press diferent button

Show information in the same dialog after press diferent button

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
25 Posts 6 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 antonio343

    Ok, finally, I got my answer. I solved of this way: I made a public variable of my dialog class, where is the edit control, in the class view, and I made the windows in the builder. After, when I press a button, I did :

    void Cprueba4View::OnButton3()
    {

    CString cadena;
    dlgDesc->GetDlgItemText(IDC\_EDIT1, cadena);
    cadena += "Hello other time ";
    dlgDesc->SetDlgItemText(IDC\_EDIT1, cadena);
    dlgDesc->SetFocus();
    

    }

    But now, I have another problem. When I maximize the windows dialog, only it's maximized the windows and not the edit control. why? how can I maximize the windows and the edit control at the same time? I used

    dlgDesc->ShowWindow(SW\_MAXIMIZE);
    

    to maximized

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

    antonio343 wrote:

    how can I maximize the windows and the edit control at the same time?

    Why can't you use SetWindowPos() on the edit control? It's a window too.

    "One man's wage rise is another man's price increase." - Harold Wilson

    "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

    "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

    A 1 Reply Last reply
    0
    • D David Crow

      antonio343 wrote:

      how can I maximize the windows and the edit control at the same time?

      Why can't you use SetWindowPos() on the edit control? It's a window too.

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

      A Offline
      A Offline
      antonio343
      wrote on last edited by
      #22

      I tried this, but it can't run. I did this:

      BOOL CEjemplo::OnInitDialog()
      {
      CDialogEx::OnInitDialog();

      // TODO:  Agregue aquí la inicialización adicional
      m\_Edit.SetMargins(10,10);
      m\_Edit.ShowWindow(SW\_MAXIMIZE);
      return TRUE;  // return TRUE unless you set the focus to a control
      // EXCEPCIÓN: las páginas de propiedades OCX deben devolver FALSE
      

      }

      is it right? If not.. how I use showWindow()?

      D 1 Reply Last reply
      0
      • A antonio343

        I tried this, but it can't run. I did this:

        BOOL CEjemplo::OnInitDialog()
        {
        CDialogEx::OnInitDialog();

        // TODO:  Agregue aquí la inicialización adicional
        m\_Edit.SetMargins(10,10);
        m\_Edit.ShowWindow(SW\_MAXIMIZE);
        return TRUE;  // return TRUE unless you set the focus to a control
        // EXCEPCIÓN: las páginas de propiedades OCX deben devolver FALSE
        

        }

        is it right? If not.. how I use showWindow()?

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

        antonio343 wrote:

        I tried this, but it can't run.

        Which means what?

        antonio343 wrote:

        m_Edit.SetMargins(10,10);

        Are you thinking that setting a control's margins will also affect it's physical dimensions?

        antonio343 wrote:

        m_Edit.ShowWindow(SW_MAXIMIZE);

        Unless the control's width and height have been changed (see SetWindowPos()), it is already maximized.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

        A 1 Reply Last reply
        0
        • D David Crow

          antonio343 wrote:

          I tried this, but it can't run.

          Which means what?

          antonio343 wrote:

          m_Edit.SetMargins(10,10);

          Are you thinking that setting a control's margins will also affect it's physical dimensions?

          antonio343 wrote:

          m_Edit.ShowWindow(SW_MAXIMIZE);

          Unless the control's width and height have been changed (see SetWindowPos()), it is already maximized.

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous

          A Offline
          A Offline
          antonio343
          wrote on last edited by
          #24

          m_Edit.SetMargins(10,10);

          is so that the text don't appear next to the border. Ok, I will try with SetWindowPos. I will tell you my progress

          A 1 Reply Last reply
          0
          • A antonio343

            m_Edit.SetMargins(10,10);

            is so that the text don't appear next to the border. Ok, I will try with SetWindowPos. I will tell you my progress

            A Offline
            A Offline
            antonio343
            wrote on last edited by
            #25

            I dont know how to use this function. Please, teach me.

            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