Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Multiline Editboxes

SelevercinSelevercin Member Posts: 26
Hi,
I have a multiline editbox where I need to do the following:

1. Figure out the number of lines entered
2. Store individual lines in a CString

Thanks,

~Selevercin

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : Hi,
    : I have a multiline editbox where I need to do the following:
    :
    : 1. Figure out the number of lines entered
    : 2. Store individual lines in a CString
    :
    : Thanks,
    :
    : ~Selevercin
    :
    [blue]I think [italic]CEdit[/italic] provides all of this.[/blue]
    [code][code=000000][color=21C6FF]
    CEdit* pMultEdit = (CEdit*) GetDlgItem (IDC_EDIT1);
    CString strLineText;
    int iLines = pMultEdit->GetLineCount ();
    int iChars;
    LPSTR pstrBuf;

    for (int i=0; iLineLength (pMultEdit->LineIndex (i));
    pstrBuf = strLineText.GetBuffer (iChars+2);
    pMultEdit->GetLine (i, pstrBuf);
    strLineText.ReleaseBuffer ();
    }
    [/color][/code][/code]
    Read MSDN about this
    -> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcemfc/htm/cedit_1.asp

    Cheers!
  • SelevercinSelevercin Member Posts: 26
    Thanks,

    This looks like it will work!

    ~Selevercin
Sign In or Register to comment.