Microsoft & .NETVisual C#Transparent RichEdit control

Transparent RichEdit control

Developer.com content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.


This article was contributed by Septimiu Pelau.

256 colors

Hicolor

Environment: VC5, NT4 SP3

CRichEditCtrlEx is derived from CRichEditCtrl and contains two methods for create the control.

The background of a rich control could be changed using SetBackgroundColor() method. When the display has 256 colors the RGB value from SetBackgroundColor() method is converted into an apropiate color from system palette. So I created a pattern brush with the desired RGB value with I filled the control in OnErasebkgnd() method. I have also treated the invalidate message because the control being transparent didn’t actualize itself.

The first image is taken from a 256 color display adapter and the second from a 16 bit one.

The method MsgFilterRich() is used for treatment the mouse or key events.

Downloads

Download demo project – 23 KB

History

Date Posted: August 08, 1999

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Latest Posts

Related Stories