Thread: Edit box scroll

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    34

    Edit box scroll

    How would one go about scrolling to the end of a multiline edit box?

    e.g. when i fill an edit box with 1000 chars, the control shows a scroll bar, but i cant make that scroll-bar scroll down automaticly!

    ive tried setscroll(x,y) but it has no effect!

    help!

    joe
    #

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Try EM_SETSEL to place the cursor at the end of the contents of the edit control, followed by a EM_SCROLLCARET to bring the cursor into view. You might only need the first message, however.

    Hope that is of some use to you.

  3. #3
    Registered User
    Join Date
    Jul 2002
    Posts
    34
    Sorry, im new to this!

    How would i do that using MFC?

    m_MyEdit.SetPropery(EM_SCROLLCARRET);

    ?

    joe
    #

  4. #4
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    I don't know MFC, but it's probably:

    m_MyEdit.SendMessage(EM_SCROLLCARET);

    You may even have to call it whenever you get a key message from the edit.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. edit box
    By beene in forum Windows Programming
    Replies: 3
    Last Post: 11-11-2006, 04:40 AM
  2. WS_HSCROLL in ES_READONLY edit box error
    By Homunculus in forum Windows Programming
    Replies: 4
    Last Post: 02-13-2006, 08:46 AM
  3. How to program a "back" button with MFC
    By 99atlantic in forum Windows Programming
    Replies: 3
    Last Post: 04-26-2005, 08:34 PM
  4. display a file in dropdown edit box
    By sunburnbyRA in forum Windows Programming
    Replies: 2
    Last Post: 03-10-2004, 01:58 PM
  5. Edit box question
    By learning110 in forum Windows Programming
    Replies: 6
    Last Post: 03-28-2003, 08:16 PM