C# 得到焦点触发的事件 怎么实现 或者失去焦点触发事件

C# 得到焦点触发的事件 怎么实现 或者失去焦点触发事件,第1张

C#失去焦点触发事件

textBox5LostFocus+=newEventHandler(txt_LostFocus);//失去焦点后发生事件

textBox5GotFocus+=newEventHandler(txt_GotFocus);//获取焦点前发生事件

textBox5MouseClick+=newMouseEventHandler(textBox5_MouseClick);//鼠标点击事件

newEventHandler(txt_LostFocus);

voidtxt_LostFocus(objectsender,EventArgse)

{

txtInput(textBox5);

}

扩展资料

C#WinForm窗体获得焦点时即触发事情

usingSystem;

usingSystemCollectionsGeneric;

usingSystemComponentModel;

usingSystemData;

usingSystemDrawing;

usingSystemText;

usingSystemWindowsForms;

namespaceWindowsApplication3

{

publicpartialclassForm1:Form

{

publicForm1()

{

InitializeComponent();

}

privatevoidbutton1_Click(objectsender,EventArgse)

{

Form2obj=newForm2(thislabel1);

objShow();

}

}

}

以上就是关于C# 得到焦点触发的事件 怎么实现 或者失去焦点触发事件全部的内容,包括:C# 得到焦点触发的事件 怎么实现 或者失去焦点触发事件、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/9754673.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-01
下一篇2023-05-01

发表评论

登录后才能评论

评论列表(0条)

    保存