vb.net 表单完全加载后的事件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12145395/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 16:15:58  来源:igfitidea点击:

Event after form is fully loaded?

vb.netwinforms

提问by tst

I want to do an event after Form_Loadevent.

我想做一个又一个Form_Load事件。

What is the event of "form fully loaded"?

“表单完全加载”是什么事件?

回答by Steve

You are looking for the event Form.Shown().

您正在寻找事件 Form.Shown()。

See the references on MSDN

请参阅 MSDN 上的参考资料

This is the last event in the event chain when you open a form as documented hereThe Form 'Load' event is raised before the form is visible, the form 'Shown' event is raised when the form is visible. (and all controls too)

这是当您打开此处记录的表单时事件链中的最后一个事件表单 'Load' 事件在表单可见之前引发,表单 'Shown' 事件在表单可见时引发。(以及所有控件)

Also, remember to avoid calls to MessageBox inside the form 'Load' event, this disrupts the normal flow of events.

另外,请记住避免在表单“Load”事件中调用 MessageBox,这会破坏事件的正常流程。

回答by Reed Copsey

You likely want to use Form.Shown. This is the last event raised during the initial display of the form.

您可能想要使用Form.Shown。这是表单初始显示期间引发的最后一个事件。

For details, see Order of Events in Windows Forms. It details which events are raised, and in which order.

有关详细信息,请参阅Windows 窗体中的事件顺序。它详细说明了引发哪些事件以及以何种顺序引发。