A text box

This is a discussion on A text box within the Windows Programming forums, part of the Platform Specific Boards category; I'm making a windows program and I went to make a text box, but there's a limit to the number ...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    7

    A text box

    I'm making a windows program and I went to make a text box, but there's a limit to the number of characters it will hold. It only holds up until the box is filled. It's fine if I just make the box extra big, but that's not what I want. This is the code I'm using:
    Code:
    hFile = CreateWindowEx(WS_EX_CLIENTEDGE,"EDIT",NULL,
    WS_CHILD | WS_VISIBLE ,
    0,40,100,25,hwnd,(HMENU)ID_FILEPATH,
    (HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE),
    NULL);
    where hFile is the handle to the text box.

    Thanks in advance.

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    I'm not sure what you want exactly but I think you want to add the style

    ES_MULTILINE

    and / or

    ES_AUTOHSCROLL

    to the edit so that it will scroll the text if it is too big to fit in the edit.

    if not,

    could you ask the question again.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,699
    novacain is absolutely right. You want to make the edit box scrollable (and multi-lined) so that the box can hold more text than its size will allow.
    Here is more info.

    gg

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    7
    thanks, that helped. But for ES_MULTILINE, that obviously gives it more than one line. But where do you specify how many lines? Or is it just automatic?

  5. #5
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,699
    An edit box can hold 64K of text. I don't know of a built-in line limiter - you may have to do that your self by responding to messages/notifications from the edit box.

    gg

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    7
    OK, thanks. I was thinking of something else, but I figured it out.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 02:59 PM
  2. Automatically enter text in a dialog box
    By leojose in forum Windows Programming
    Replies: 6
    Last Post: 12-13-2005, 11:59 AM
  3. Dynamically add statis text to a dialog box
    By earth_angel in forum Windows Programming
    Replies: 8
    Last Post: 06-23-2005, 02:28 PM
  4. Sending text to an edit box
    By ColdFire in forum Windows Programming
    Replies: 1
    Last Post: 09-24-2002, 08:46 PM
  5. Getting my text from edit box
    By Marky_Mark in forum Windows Programming
    Replies: 2
    Last Post: 11-16-2001, 01:06 PM

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