-
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.
-
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.
-
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
-
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?
-
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
-
OK, thanks. I was thinking of something else, but I figured it out.