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. Multi-line string into dialog box

Multi-line string into dialog box

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 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.
  • I Offline
    I Offline
    itkid
    wrote on last edited by
    #1

    Hi, I am trying to write a multi-line string into an edit control on a dialog box. I am using following code however not getting any success.

    CWnd *pWnd =GetDlgItem(IDC_STATIC_MSGCNT);
    CRect lpRect = CRect(100,100,20,20);
    pWnd->GetWindowRect(&lpRect);

    		CEdit \*pEdit = new CEdit();
    	
    		pEdit->Create(ES\_MULTILINE|ES\_LEFT|ES\_READONLY,lpRect,this,m\_iEditCTLID++);
    		pEdit->ShowWindow(SW\_SHOW);
    		CString str;
    		str.Format("%d",pWLSErrRpt->GetWLSMessageNo());
    		pEdit->SetWindowTextA(str);
    

    Appreciate your help. Thanks

    K D 2 Replies Last reply
    0
    • I itkid

      Hi, I am trying to write a multi-line string into an edit control on a dialog box. I am using following code however not getting any success.

      CWnd *pWnd =GetDlgItem(IDC_STATIC_MSGCNT);
      CRect lpRect = CRect(100,100,20,20);
      pWnd->GetWindowRect(&lpRect);

      		CEdit \*pEdit = new CEdit();
      	
      		pEdit->Create(ES\_MULTILINE|ES\_LEFT|ES\_READONLY,lpRect,this,m\_iEditCTLID++);
      		pEdit->ShowWindow(SW\_SHOW);
      		CString str;
      		str.Format("%d",pWLSErrRpt->GetWLSMessageNo());
      		pEdit->SetWindowTextA(str);
      

      Appreciate your help. Thanks

      K Offline
      K Offline
      KingsGambit
      wrote on last edited by
      #2

      Multiline editbox requires "\r\n" in the string to split the string into multiple lines.

      1 Reply Last reply
      0
      • I itkid

        Hi, I am trying to write a multi-line string into an edit control on a dialog box. I am using following code however not getting any success.

        CWnd *pWnd =GetDlgItem(IDC_STATIC_MSGCNT);
        CRect lpRect = CRect(100,100,20,20);
        pWnd->GetWindowRect(&lpRect);

        		CEdit \*pEdit = new CEdit();
        	
        		pEdit->Create(ES\_MULTILINE|ES\_LEFT|ES\_READONLY,lpRect,this,m\_iEditCTLID++);
        		pEdit->ShowWindow(SW\_SHOW);
        		CString str;
        		str.Format("%d",pWLSErrRpt->GetWLSMessageNo());
        		pEdit->SetWindowTextA(str);
        

        Appreciate your help. Thanks

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

        itkid wrote:

        I am trying to write a multi-line string into an edit control...

        No, you are writing a number to the control.

        "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

        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