MsgBox出现在窗体打开新窗体时

编程入门 行业动态 更新时间:2024-10-27 15:25:05
本文介绍了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出现在窗体打开新窗体时

本文发布于:2023-11-11 16:58:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1579033.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:窗体   出现在   开新   MsgBox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!