Placing a image inside an CEdit control in Win32

723 Views Asked by At

I'm trying to achieve an effect where there's a visible logo inside an edit control and the logo becomes hidden when the user places the focus on the edit control.

What's the best way to approach this? Would it be better to place an image control on top of the edit control or paint the background of the edit control transparent and position the image control behind the edit control? Or possibly some other method?

1

There are 1 best solutions below

1
On

The EDIT control has very broken paint behavior, you'll never get there by overriding the WM_PAINT message handler or using transparency. Yes, overlay it with a STATIC control that you hide when you see text being entered.