using System;
using System;using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
textBox1.Text = "请输入账号";
textBox1.ForeColor = Color.Gray;
}
private void textBox1_Click(object sender, EventArgs e)
{
textBox1.Text = "";
textBox1.ForeColor = Color.Black;
}
}
}
我是初学的,我想要的效果是当鼠标点击文本框的时候,初始化的字消失,但是当我点进里面那些字还是不会消失,请问代码是哪里的问题,求指点。