[C#] 纯文本查看 复制代码 public String WaterText { get; set; } private void textBox1_Enter(object sender, EventArgs e) { if (textBox1.Text == WaterText || textBox1.Text == "") { textBox1.Text = ""; textBox1.ForeColor = Color.Black; } } private void Form1_Load(object sender, EventArgs e) { WaterText = "要设置的水印文字"; textBox1.Text = WaterText; textBox1.ForeColor = Color.Gray; } private void textBox1_Leave(object sender, EventArgs e) { if (textBox1.Text == "" || textBox1.Text == WaterText) { textBox1.Text = WaterText; textBox1.ForeColor = Color.Gray; } } |
复合物后和人格让我会更好 |
感谢分享。 |
谢谢楼猪分享,楼猪辛苦了~ |
好文章!谢谢楼主 |
好文章!谢谢楼主 |
强学习了... |
试了,没效果啊,需要注意什么吗?textbox的属性? |
测试了不行,有什么要注意的吗? |