|
-
October 12th, 2009, 11:57 AM
#1
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.
-
October 12th, 2009, 01:17 PM
#2
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).
-
October 12th, 2009, 02:59 PM
#3
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);
-
October 12th, 2009, 05:47 PM
#4
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|