简体   繁体   English

vb6表格自动重装

[英]vb6 form auto reloads

I'm working on a VB6 app that was coded by someone else a long time ago. 我正在开发一个很久以前由别人编码的VB6应用程序。 When it's doing its thing, the form reloads on exit in an attempt to retry(?). 在执行其操作时,该窗体会在退出时重新加载,以尝试重试(?)。

Does anyone know how this would be accomplished so that I can STOP IT. 有谁知道这将如何完成,以便我可以停止它。 I've dug through the entire program and can't see where this would be happening. 我已经浏览了整个程序,看不到这将在哪里发生。

It is likely the form or one of its controls is being referenced after it has been unloaded, and this is causing it to re-load. 这是有可能已被卸载后,被引用的形式或其控件之一,这也是造成其重新装入。

The easiest way to tell what is causing it is to run the form, put a BreakPoint at the end of the Form_Load event then close it. 判断原因的最简单方法是运行表单,在Form_Load事件的末尾放置一个BreakPoint ,然后将其关闭。 Then, when it re-loads, press F8 to (hopefully*) step into the line of code immediately following the one that caused it. 然后,在重新加载代码时,按F8键(希望*)立即进入引起该代码的代码行。

Once you have established what the cause is, it ought to be relatively straightforward to amend your code to prevent it. 确定原因后,修改代码以防止这种情况应该相对简单。

*Timer events or other asynchronous code may divert execution away from the culprit code, in which case you will have to first stop any affecting processes – timers etc. – in the immediate window before you begin to step forward with F8. *计时器事件或其他异步代码可能会将执行转移到罪魁祸首代码,在这种情况下,您必须首先在立即窗口中停止所有影响进程(计时器等),然后再开始使用F8。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM