/ Published in: C++
Set textbox to multi-line. ASSERT statement verifies.
Apparently executes quicker than GetWindowText, Append, SetWindowText.
Appears to auto-scroll otherwise, use this to scroll to bottom:
edit.SendMessage(WM_VSCROLL, SB_BOTTOM, 0 );
Haven't figured out how to stop scrolling when it's not already at the bottom.
Apparently executes quicker than GetWindowText, Append, SetWindowText.
Appears to auto-scroll otherwise, use this to scroll to bottom:
edit.SendMessage(WM_VSCROLL, SB_BOTTOM, 0 );
Haven't figured out how to stop scrolling when it's not already at the bottom.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
void AppendLineToMultilineEditCtrl(CEdit& editArg, LPCTSTR pszTextArg ) { ASSERT( editArg.GetStyle() & ES_MULTILINE ); // Should be a multi-line style. 0x0004L int nLength = editArg.GetWindowTextLength(); // get the initial text length editArg.SetSel(nLength, nLength); // go to the end. editArg.ReplaceSel(" "); // add CrLf nLength+=2; // Add length of CrLf editArg.SetSel(nLength, nLength); // go after CrLf. editArg.ReplaceSel(pszTextArg); // add the string. }