Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Multi-line CEditView

Posted on 1998-05-11
4
Medium Priority
?
848 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 200 total points
ID: 1309736
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
ID: 1309737
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
ID: 1309738
Also turn off WS_HSCROLL style.
0
 

Author Comment

by:trovatore
ID: 1309739
That's got it; thanks.

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

618 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