CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2000
    Posts
    199

    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

  2. #2
    Join Date
    Apr 2004
    Posts
    2

    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.

  3. #3
    Join Date
    Jul 2002
    Posts
    2,543

    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...

  4. #4
    Join Date
    Apr 2004
    Posts
    2

    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".

  5. #5
    Join Date
    Jul 2002
    Posts
    2,543

    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.

  6. #6
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: Scrolling a multiline Edit(box) automatically (Win32)

    Quote Originally Posted by Alex F View Post
    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?
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured