What is he best way to implement Watermark functionality for a System.Windows.Forms.TextBox in .Net 2.0 with C#?
Edit:
Using the ready-made component from CodeProject was very easy. It’s also with a The Code Project Open License (CPOL).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.