且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

水印System.Windows.Forms.TextBox

更新时间:2023-12-06 14:22:34

最近我需要一个水印的文本框,那突然出现在我的头上的第一件事就是OnLeave和的OnEnter文本框的事件,但首先我GOOGLE了它,我有两个链接第一个是它使用了System.Drawing命名空间,另外一个在这里使用SendMessage()在这里http://vidmar.net/weblog/archive/2008/11/05/watermarked-textbox-in-windows-forms-on-.net.aspx.

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.

我beleive的SendMessage函数则相对比较简单,它也有它自己没有闪烁。虽然我用它。

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.