|
-
March 6th, 2006, 05:55 AM
#1
edit field unlimited chars?
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?
-
March 6th, 2006, 06:03 AM
#2
Re: edit field unlimited chars?
 Originally Posted by vivendi
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 ....
It takes seconds for rating…that actually compensates the minutes taken for giving answers
The biggest guru-mantra is: Never share your secrets with anybody. It will destroy you.
Regards, Be generous->Rate people
Jayender!!
-
March 6th, 2006, 06:04 AM
#3
Re: edit field unlimited chars?
In this sample, the bold line makes the edit control to use unlimited memory for the text that can be contained by the control:
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);
Regards,
-
March 6th, 2006, 06:07 AM
#4
Re: edit field unlimited chars?
Without MFC code please...
-
March 6th, 2006, 06:11 AM
#5
Re: edit field unlimited chars?
 Originally Posted by jayender.vs
how about using Multiline Edit Control ....
That won't solve his problem... since Multiline Edit control will also limit the buffer size by default.
@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,
-
March 6th, 2006, 06:30 AM
#6
Re: edit field unlimited chars?
[ 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.
-
March 6th, 2006, 10:50 AM
#7
Re: edit field unlimited chars?
 Originally Posted by vivendi
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?
Just use the ES_AUTOHSCROLL style.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|