-
May 13th, 2012, 12:39 PM
#1
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
Tags for this Thread
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
|