简体   繁体   English

制作“离开文本框”事件

[英]Making a "leave textbox" event

How can I make an event so when I leave a text box it enables a certain button?如何创建一个事件,以便在我离开文本框时启用某个按钮? I'm pretty sure I need to somehow use the focus control but I don't know how.我很确定我需要以某种方式使用焦点控制,但我不知道如何使用。

Simply use the Leave event of the control, see some examples on MSDN . 只需使用控件的Leave事件,请参见MSDN上的一些示例。

private void textBox1_Leave(object sender, System.EventArgs e)
{
    this.button1.Enabled = true;
}

use this syntax textbox1_TextChanged使用此语法 textbox1_TextChanged

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM