Solved

RichEdit background

Posted on 1998-11-19
4
491 Views
Last Modified: 2012-05-05
Does anyone know if it is possible to put a background image behind a RichEdit control or a CRichEditView derived window.
I know how to change the background color, but need to place a bitmap behind the control.  Do I need the bitmap in a window behind the RichEdit one?

I need to make it look like the text is being typed over an image.  
0
Comment
Question by:shudecek
[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
4 Comments
 
LVL 2

Expert Comment

by:cyrilbdt
ID: 1178281
ovveride OnEraseBkgnd and there draw your bitmap
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1178282
Unfortunately, that won't work. If you're using CRichEditView, you're using RichEdit 1.0.  RichEdit 1.0 doesn't draw transparent text. You can't handle it's erase background, and you can't subclass it's painting to convince it to do so.

You're just out of luck.

RichEdit 2.0 can help you do what you want, but it is not yet supported by MFC.

B ekiM
0
 

Author Comment

by:shudecek
ID: 1178283
I tried that, I also tried overriding OnDraw, OnPaint, neither work.  I'll look more into RichEdit 2.0. Thanks
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 50 total points
ID: 1178284
You'll find that you can simply override PreCreateWindow or Create to have it create the new class.  You'll also need to loadlibrary RICHEDIT20 instead of calling AfxInitRichEdit().

Depending on how aggressively you use the class, thogh, you might need to do more than override the creation and hcange the initialization--it's possible that you'll need to start from scratch. This much work can make the notion of haivng a background bitmap a little bit too expensive--and you you might want to reconsider that feature for your application.

B ekiM


0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

756 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