Hello, i've created an edit field, but it can't contain an unlimited amount of chars. The width of the edit field is the max number of chars, how can i make this go away so that it can contain as many chars as i want?
Printable View
Hello, i've created an edit field, but it can't contain an unlimited amount of chars. The width of the edit field is the max number of chars, how can i make this go away so that it can contain as many chars as i want?
how about using Multiline Edit Control ....Quote:
Originally Posted by vivendi
In this sample, the bold line makes the edit control to use unlimited memory for the text that can be contained by the control:Regards,Code:CEdit::Create(
WS_CHILD|WS_VISIBLE|WS_TABSTOP
|ES_AUTOHSCROLL|ES_AUTOVSCROLL
|ES_LEFT
|(isMultiline?ES_WANTRETURN|ES_MULTILINE/*|WS_HSCROLL*/|WS_VSCROLL:0)
,rcCtl,pParent,IDC_EDIT_BOX + (++count));
CEdit::SetLimitText(0);
Without MFC code please...
That won't solve his problem... since Multiline Edit control will also limit the buffer size by default.Quote:
Originally Posted by jayender.vs
@vivendi: Another way of changing the behaviour of the control, using only APIs (no MFC derived class), would be to send EM_SETLIMITTEXT message to the control (using SendMessage API). Give both wParam & lParam as 0 (zero) in order to disable max_characters check.
Regards,
[ Moved thread ]
Well, everything has a limit.
The max limit that can be set (by passing zero in wParam when sending EM_SETLIMITTEXT/EM_LIMITTEXT message) depends on edit type (single or multiline) and the operating system
- Windows 95/98
- 0x7FFE for single line edit control
- 0xFFFF for multiline edit control
- Windows NT/2000/XP
- 0x7FFFFFFE for single line edit control
- 0xFFFFFFFF for multiline edit control
If you want to step beyond these limits use rich edit control.
Just use the ES_AUTOHSCROLL style.Quote:
Originally Posted by vivendi