Watermark in System.Windows.Forms.TextBox Watermark in System.Windows.Forms.TextBox windows windows

Watermark in System.Windows.Forms.TextBox


lately I needed a watermark textbox, the first thing that popped in to my head was OnLeave and OnEnter events of textbox, but first I googled it and I got two links first was the one in CodeProject which used the System.Drawing namespace and the other one was here using the SendMessage() over here http://vidmar.net/weblog/archive/2008/11/05/watermarked-textbox-in-windows-forms-on-.net.aspx.

I beleive the SendMessage one is much easier and it also has no flickering in it. though I used it.

I hope it will be helpful for you.


It is not as straightforward as one would think. You need to use using the System.Drawing namespace and override the OnPaint event.

Here are some links of some people that have already done it.

Link & Link