1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Writing Onto Multiple Lines, Edit Box

Discussion in 'MFC' started by dkaksl, Dec 13, 2011.

  1. dkaksl

    dkaksl Guest

    So I was trying to write the contents of a CSV into an edit box, using this:

    Code:
    for(int i = 0; i <= 90; i++)
    {
    	m_strData.Format("%d,\t %d,\t %d,\t %d,\t %d\r\n", a[i], b[i], c[i], d[i], e[i]);
    }
    but it didn't work, however, writing it like this:

    Code:
    m_strData.Format("%d,\t %d,\t %d,\t %d,\t %d\r\n %d,\t %d,\t %d,\t %d,\t %d\r\n %d,\t %d,\t %d,\t %d,\t %d\r\n ...", a[0], b[0], c[0], d[0], e[0], a[1], b[1], c[1], d[1], e[1], a[2], b[2], c[2], d[2], e[2], ...);
    did work. Anyone know of an easier way to do what I'm trying to do? Links to tutorials and such are also much appreciated.
     
  2. ASGGSA

    ASGGSA New Member

    Joined:
    Jul 29, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Programmer
    Hello.
    You can use Rich Edit control.
    for example :
    Code:
    m_Richedit.Format("%d,\t %d,\t %d,\n %d,\t %d\r\n", 1, 2, 3, 4, 5);
    UpdateData(false);
    
     

Share This Page