multiline editbox

This is a discussion on multiline editbox within the Windows Programming forums, part of the Platform Specific Boards category; Hi How would I go about adding more than 1 line of text to the edit box? I've looked at ...

  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, 01:37 PM
  2. Replies: 2
    Last Post: 08-25-2005, 04:09 PM
  3. Create two buttons that interact with an editbox
    By Arkanos in forum Windows Programming
    Replies: 8
    Last Post: 07-13-2005, 01:56 AM
  4. Create two buttons that interact with an editbox
    By Arkanos in forum C++ Programming
    Replies: 4
    Last Post: 07-11-2005, 02:17 AM
  5. editbox problem
    By tyouk in forum Windows Programming
    Replies: 7
    Last Post: 10-05-2004, 10:14 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21