MsgBox出现在窗体打开新窗体时 [英] MsgBox Appearing Before Form When New Form Opens

查看:113
本文介绍了MsgBox出现在窗体打开新窗体时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我初始化要打开的新表单时,新表单中的子例程在屏幕上显示新表单之前就开始了,因此,当该子例程完成并且MsgBox出现时,该表单就不会显示.

有没有办法让该子程序开始之前先弹出表单?

非常感谢您的任何帮助.

Hi,

When I initialize a new form to open, the subroutine in the new form starts before the new form is shown on the screen and so when the subroutine finishes and the MsgBox comes up, the form isn''t showing.

Is there a way to make the form pop up first before the subroutine starts?

Thanks a lot for any help

推荐答案

我认为您是在Load 事件中调用它的.您需要在Shown 事件中调用它(仅触发一次).

I reckon you are calling it in the Load event. You need to call it in the Shown event (fired only once).

private void Form1_Shown(object sender, EventArgs e)
{
    MessageBox.Show("***");
}


这篇关于MsgBox出现在窗体打开新窗体时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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