为什么Form1会自行关闭? [英] Why does Form1 keep closing itself?

查看:118
本文介绍了为什么Form1会自行关闭?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



当我点击一个按钮时,它会显示一个摄像机查看屏幕。在该表单的加载事件中,它尝试连接到串行端口上的摄像头。我没有连接相机,所以它显示了一个自定义的错误,然后应该关闭表单并显示Form1。



问题是Form1从不显示,我'已调试,发现Form_Formclosing事件永远不会触发,虽然句柄是正确的。



请不要告诉我有腐败因为项目很大而且我不喜欢我想重写它



-ricky

Hello there,

When I click a button, it shows a camera viewing screen. on that form's load event, it tries to connect to a camera on a serial port. I have no camera attached, so it shows a customized error, and then should close the form and show Form1.

The problem is that Form1 never shows, and I've debugged, to find that the Form_Formclosing event never fires, although the handle is correct.

Please don't tell me there's corruption as the project is huge and I don't want to rewrite it

-ricky

推荐答案

表格直到<$才显示c $ c> Form_Load 事件已完成。要在 Form_Load 事件中更早地显示它,请在 Form_Load中放置 Me.Show 在您希望显示表单的位置的事件。
The form does not show until the Form_Load event is complete. To show it earlier in the Form_Load event, place Me.Show in the Form_Load event at the location where you want the form to be displayed.


这篇关于为什么Form1会自行关闭?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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