Solved

RichEdit background

Posted on 1998-11-19
4
485 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
  • 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

744 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

10 Experts available now in Live!

Get 1:1 Help Now