trovatore
asked on
Multi-line CEditView
I'm having a terrible time getting text to wrap in
a CEditView window. I'm not certain if the underlying
CEdit is single-line or multi-line; it's acting like
single-line. I tried overriding PreCreateWindow as
follows:
BOOL MyEditView::PreCreateWindo w(CREATEST RUCT& cs)
{
m_dwDefaultStyle = dwStyleDefault | ES_MULTILINE;
return CCtrlView::PreCreateWindow (cs);
}
but that didn't work (and actually when I commented out
the " |ES_MULTILINE " part of the first line and looked
at m_dwDefaultStyle , it appeared that ES_MULTILINE was
set without my intervention).
There doesn't seem to be any member that tells me explicitly
whether I've succeeded in making the control multi-line.
I've tried calling CEdit::SetMargins(), CEdit::FmtLines(),
and CEdit::SetRect() on the control, and no matter
what I do, the text *just* *won't* *wrap*.
If it matters, the CEditView window is a pane of
a splitter window.
a CEditView window. I'm not certain if the underlying
CEdit is single-line or multi-line; it's acting like
single-line. I tried overriding PreCreateWindow as
follows:
BOOL MyEditView::PreCreateWindo
{
m_dwDefaultStyle = dwStyleDefault | ES_MULTILINE;
return CCtrlView::PreCreateWindow
}
but that didn't work (and actually when I commented out
the " |ES_MULTILINE " part of the first line and looked
at m_dwDefaultStyle , it appeared that ES_MULTILINE was
set without my intervention).
There doesn't seem to be any member that tells me explicitly
whether I've succeeded in making the control multi-line.
I've tried calling CEdit::SetMargins(), CEdit::FmtLines(),
and CEdit::SetRect() on the control, and no matter
what I do, the text *just* *won't* *wrap*.
If it matters, the CEditView window is a pane of
a splitter window.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also turn off WS_HSCROLL style.
ASKER
That's got it; thanks.
ASKER
there's nothing in it; if I just enter a bunch of text I
want it to wrap when it gets to the right margin. And it
doesn't.
I did have ES_AUTOHSCROLL on but now I don't, and it hasn't
fixed it.