use CRichEditCtrl as text output
Hi world,
I want to use a multiline CRichEditCtrl control with vertical scrolling as an output field for messages to the user (similar to the message window at the bottom a Visual Studio). I have set the field to be read only, but I have not found a straightforward way to append the existing text lines with new additional text. Currently I use:
int num = my_ctrl->GetWindowTextLength();
my_ctrl->SetSel(num, num);
my_ctrl->ReplaceSel(new_message);
Is there a more convenient way to append the existing text? How can I make the CRichEdit control scroll to the end each time new text is added (like the one in Visual Studio does)?
If I use CEdit instead of CRichEditCtrl, it scrolls to the tzext end automatically when the above code is called - but the CRichEditCtrl remains at the top of the text...
Jens
[email protected]
Re: use CRichEditCtrl as text output
Try my_ctrl.SetSel(-1, -1) instead of (num, num).
HTH
K.
Ash to ash and clay to clay, if the enemy doesn't get you, your own folk may.