dcsimg
November 27, 2020
Hot Topics:

Transparent RichEdit control

  • By Septimiu Pelau
  • Send Email »
  • More Articles »

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






This article was originally published on August 8, 1999

Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.


Thanks for your registration, follow us on our social networks to keep up-to-date