Solved

Multi-line CEditView

Posted on 1998-05-11
4
825 Views
Last Modified: 2013-11-20
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.
0
Comment
Question by:trovatore
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 50 total points
Comment Utility
Make sure that the text you entered or reading from a file has a \r\n as the paragraph mark.

Additionally, check to make sure your edit control does not have WS_AUTOHSCROLL as a style (use GetStyle()).
0
 

Author Comment

by:trovatore
Comment Utility
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.

0
 
LVL 15

Expert Comment

by:Tommy Hui
Comment Utility
Also turn off WS_HSCROLL style.
0
 

Author Comment

by:trovatore
Comment Utility
That's got it; thanks.

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Folder Comparison 12 52
not able to insert into temp table 68 150
sum67 challenge 35 88
unix example issues 18 44
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now