窗体问题(菜鸟) 我想设置 当窗体上文本框开始输入的时候, 文本框的背景色就变, 当文本框失去焦点的时候, 在回到原来的属性设置颜色, 如何实现???拜托各位!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在 GotFocus LoseFocus 事件里面写。 private void textBox1_Enter(object sender, EventArgs e) { textBox1.BackColor = Color.Gray; } private void textBox1_Leave(object sender, EventArgs e) { textBox1.BackColor = Color.White; } //textBox1_Leave //textBox1_Enter this.textBox1.textBox1_Enter += new System.EventHandler(this.textBox1_Enter); this.textBox1.textBox1_Leave += new System.EventHandler(this.textBox1_Leave);具体这两个方法是怎么定义的??? 在 GotFocus LoseFocus 事件里面写。 双击直接进入下面了啊??? private void textBox1_TextChanged(object sender, EventArgs e) { } 点TextBox控件,在右边的属性面板里面找到一个闪电的按钮,切换到事件。找到 GotFocus,双击。 没看到 GotFocus LoseFocus 事件啊?现在输入时候颜色改变 可以实现了 , 下面连个都可以 . 但是 当焦点离开的时候怎么变色呢?? private void textBox1_Leave(object sender, EventArgs e) { textBox1.BackColor = Color.Cornsilk ; } private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { textBox1.BackColor = Color.Cornsilk; } 根据周次反推日期区间,求最佳算法 WINDOWS2008上的excel操作 高分求解!!!soket编程,这个为什么只能单方接受(p2p)(c#) 谁有上海先锋商泰 笔试题目 求救! 控件重绘太慢 sql数据库的问题100分 能得到结果就结贴给分 Winform程序,多界面同时进行思路。 load xml文件时出现系统不支持gbk的错误 如何实现ProgressBar的透明效果??? 编写“个性化窗体”出现的问题(附源码) 调用webservice的问题 使用ExecuteNonQuery执行sql更新数据库后,为什么数据库无法删除
{
textBox1.BackColor = Color.Gray;
} private void textBox1_Leave(object sender, EventArgs e)
{
textBox1.BackColor = Color.White;
}
//textBox1_Enter
this.textBox1.textBox1_Enter += new System.EventHandler(this.textBox1_Enter);
this.textBox1.textBox1_Leave += new System.EventHandler(this.textBox1_Leave);
具体这两个方法是怎么定义的???
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
{
textBox1.BackColor = Color.Cornsilk ;
} private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
textBox1.BackColor = Color.Cornsilk;
}