Thread: Edit box

  1. #1
    Registered User morbuz's Avatar
    Join Date
    Aug 2001
    Posts
    35

    Question Edit box

    How can I get an Edit box to fill a window, no matter what the size of the window is?
    [Signature here. (Remove this!)]

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Try this..


    Code:
    hedwnd = CreateWindow("edit",NULL,WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL
    		  | WS_BORDER | ES_LEFT | ES_MULTILINE 
    		  | ES_AUTOHSCROLL | ES_AUTOVSCROLL,0,0,0,0, hwnd, (HMENU) 1,
    		  hinst , NULL);
    .. Under the WM_CREATE case.

    Then under WM_SIZE....

    Code:
    MoveWindow(hedwnd,0,0,LOWORD(lParam),HIWORD(lParam),TRUE);
    I haven't sat and tested as I'm sitting here, but if I remember correctly that should do the trick.

  3. #3
    Registered User morbuz's Avatar
    Join Date
    Aug 2001
    Posts
    35

    Smile Thanks!

    Works perfectly, thanks!
    [Signature here. (Remove this!)]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  2. edit box
    By beene in forum Windows Programming
    Replies: 3
    Last Post: 11-11-2006, 04:40 AM
  3. edit box affecting displaying of text?
    By algi in forum Windows Programming
    Replies: 4
    Last Post: 05-04-2005, 03:28 PM
  4. How to program a "back" button with MFC
    By 99atlantic in forum Windows Programming
    Replies: 3
    Last Post: 04-26-2005, 08:34 PM
  5. display a file in dropdown edit box
    By sunburnbyRA in forum Windows Programming
    Replies: 2
    Last Post: 03-10-2004, 01:58 PM