Scrolling a multiline Edit(box) automatically (Win32)
I'd like to scroll to the bottom of an Edit automatically whenever a line is added, so I wrote this:
SendMessage(hWnd(), LOWORD(WM_VSCROLL), SB_BOTTOM, 0);
hWnd() returns the hwnd of the edit.
This worked just fine under Win2k but it doesn't work at all under Win98. What am I doing wrong?
---
Regards,
Vitaly Belman
ICQ: 1912453
Re: Scrolling a multiline Edit(box) automatically (Win32)
Try writing something like this:
Code:
//////////////// My Edit Box Control settings: ////////////////////
EDITTEXT IDC_EDIT1,12,88,396,98,ES_MULTILINE | ES_AUTOVSCROLL | WS_VSCROLL
CString m_EditBoxValue;
DDX_Text(pDX, IDC_EDIT1, m_EditBoxValue);
//////////////////////////////////////////////////////////////////////////
CEdit * eb;
eb = (CEdit*)GetDlgItem(IDC_EDIT1); // Set V
//this is an example
for (int i = 0; i < 1000; i++)
{
m_EditBoxValue += "New Text ABCDEFGHIJKLMNOPQRSTUVWXYZ Tralalalalalalalalal";
UpdateData(FALSE);
eb->LineScroll(eb->GetLineCount());
Hope, someone finds it useful.
Re: Scrolling a multiline Edit(box) automatically (Win32)
I am sure Vitaly Belman is happy to read this after wating 9 years for an answer...
Re: Scrolling a multiline Edit(box) automatically (Win32)
"Hope, someone finds it useful."
I do not expect some people to understand what they read and why I have posted that replay. Some are just too narrow minded i.e. lack of imagination ;) Have a nice day "Einstein". :)
Re: Scrolling a multiline Edit(box) automatically (Win32)
Sorry, I really didn't understand how important is to solve Win98 problems... It is not enough that program runs successfully in Win2K - we should not forget about Win98/95 users.
Re: Scrolling a multiline Edit(box) automatically (Win32)
Quote:
Originally Posted by
Alex F
Sorry, I really didn't understand how important is to solve Win98 problems... It is not enough that program runs successfully in Win2K - we should not forget about Win98/95 users.
The question is: was this solution even tested on Win98? :)