Link to home
Start Free TrialLog in
Avatar of trovatore
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::PreCreateWindow(CREATESTRUCT& 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.
ASKER CERTIFIED SOLUTION
Avatar of Tommy Hui
Tommy Hui

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of trovatore
trovatore

ASKER

I don't follow the first sentence.  When the box comes up
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.

Also turn off WS_HSCROLL style.
That's got it; thanks.