如何在加载表单后执行代码? [英] How do I execute code AFTER a form has loaded?

查看:27
本文介绍了如何在加载表单后执行代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 .NET 中,Windows 窗体有一个在窗体加载前触发的事件 (Form.Load),但在窗体加载后没有触发相应的事件.我想在表单加载后执行一些逻辑.

In .NET, Windows Forms have an event that fires before the Form is loaded (Form.Load), but there is no corresponding event that is fired AFTER the form has loaded. I would like to execute some logic after the form has loaded.

谁能就解决方案提出建议?

Can anyone advise on a solution?

推荐答案

您可以使用Shown"事件:MSDN - Form.Shown

You could use the "Shown" event: MSDN - Form.Shown

仅在第一次显示表单时引发 Shown 事件;随后最小化、最大化、恢复、隐藏、显示或无效和重新绘制将不会引发此事件."

"The Shown event is only raised the first time a form is displayed; subsequently minimizing, maximizing, restoring, hiding, showing, or invalidating and repainting will not raise this event."

这篇关于如何在加载表单后执行代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆