Add New line to multiline textbox
Ok i've tryed to google it but not the results i need and not the right language so i'm gonna ask it here:
How to add a new line to a multiline textbot control in Win32 Visual C++.
And for example how to add the text to that textbox: Example
Code:
char Buffer = "a little buffer";
char Buffer2 = GetDlgItemText(......);
SetDlgItemText(hWnd, TXT1, Buffer + Buffer2);
that seems to be an incorrect way and i can't seem to find the correct one >.<
Any help will be useful.
Re: Add New line to multiline textbox
You need to add a CR-LF pair for a new line in a multiline edit control. strcat() it to the first string, or make a third buffer with sprintf(). (Or use a string class like CString that supports "+" operator overloads).
Re: Add New line to multiline textbox
CString Buffer1 = _T("a little buffer");
CString Buffer2 = _T("another little buffer");
CString Buffer3 += _T("\r\n");
Buffer3 += Buffer2;
SetDlgItemText(hWnd, TXT1, Buffer3);
Re: Add New line to multiline textbox
First see How to append text to an edit control?.
Also, as already suggested here, append a CR-LF ("\r\n") for a new line.