0

I am trying to make a textbox with a watermark text on winforms. I have created a custom textbox (inherited from TextBox) and am Painting the watermark. The problem is that the text inside the textbox gets white (disappears) as soon as I enter the textbox with my mouse.

I think it is because the textbox gets invalidated when the mouse enters the region without calling the paint method.

Any ideas how to fix this behaviour?

Thanks!

El Mac
  • 3,256
  • 7
  • 38
  • 58
  • for gods sake ,,can you post the code,,,the user defined – HackerMan Apr 07 '14 at 08:29
  • There is no code to post, as the ONLY thing I've done so far is to SetStyle UserPaint. Thanks for your constructive answer. – El Mac Apr 07 '14 at 08:33
  • 1
    possible duplicate of [Can a background image be set on a Winforms TextBox?](http://stackoverflow.com/questions/4360301/can-a-background-image-be-set-on-a-winforms-textbox) – Hans Passant Apr 07 '14 at 11:36
  • Even if the question you posted has nothing to do with mine, it answered my question. Thanks. – El Mac Apr 07 '14 at 11:43

0 Answers0