How to stop autoscrolling on the CEdit control.
Hello,
I've written some app in MFC for logging through the COM port of my PC, all data I receive I put into CEdit control, and here I have a issue, sometimes it is necessary for me to analyze data and I wish to stop autoscrolling of my control and just freeze on current view for a while, during that time I wish to my incoming data still were written to the control. Is there anybody who can advise me how to accomplish such a functionality ?
Please take a look on function by which a add data into my control,
b_DataFreezeToggle variable is a toggle variable I've tried to get number of line to which my view supposed to return after filling control.
Code:
void MyDialog::AppendTextToEditCtrl(CEdit& edit, LPCTSTR pszText) {
// get the initial text length
int nLength = edit.GetWindowTextLength();
// put the selection at the end of text
edit.SetSel(nLength, nLength);
// replace the selection
edit.ReplaceSel(pszText);
if(b_DataFreezeToggle) {
vs_debug("Selection set %d\n",nFreezedPos) ;
edit.SetSel(nFreezedPos, nFreezedPos,FALSE);
}
}
Please take a quick look, I'd really appreciate your help
Cheers
Lazureus
Re: How to stop autoscrolling on the CEdit control.
Edit control is not convenient for this purpose (simultaneous logging + analyzing).
ListBox could be more appropriate for this purpose. Have a look at A Logging ListBox Control
Re: How to stop autoscrolling on the CEdit control.
Quote:
Originally Posted by
lazureus
Is there anybody who can advise me how to accomplish such a functionality ?
Did you read the documentation for CEdit::SetlSel? What does the last argument do?
Re: How to stop autoscrolling on the CEdit control.
Hello,
thank you very much for your reply, I think Victor's example is what I was looking for :) Great thanks one more time :)
BR,
Lazureus