Thread: multiline editbox

  1. #1
    manics
    Guest

    multiline editbox

    Hi
    How would I go about adding more than 1 line of text to the edit box? I've looked at WM_SETTEXT but that will only add text to the first line, the EM_LINESCROLL won't scroll to a new line and the other EM scroll messages dont want to work either. Its probably a message ive overlooked but when you've been staring at the same code for hours...well you know how it is

  2. #2
    Registered User
    Join Date
    Sep 2002
    Posts
    254
    void PostText(HWND hedit, string message)
    {
    message+="\r\n";
    int ndx = GetWindowTextLength (hedit);
    SendMessage (hedit, EM_SETSEL, (WPARAM)ndx, (LPARAM)ndx);
    SendMessage (hedit, EM_REPLACESEL, 0, (LPARAM) ((LPSTR) message.c_str()));
    }
    Last edited by ZerOrDie; 03-16-2003 at 03:47 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 07-21-2007, 12:37 PM
  2. Replies: 2
    Last Post: 08-25-2005, 03:09 PM
  3. Create two buttons that interact with an editbox
    By Arkanos in forum Windows Programming
    Replies: 8
    Last Post: 07-13-2005, 12:56 AM
  4. Create two buttons that interact with an editbox
    By Arkanos in forum C++ Programming
    Replies: 4
    Last Post: 07-11-2005, 01:17 AM
  5. editbox problem
    By tyouk in forum Windows Programming
    Replies: 7
    Last Post: 10-05-2004, 09:14 PM