问题描述
大家好,
我注意到Form Unload& amp;在VB3和VB6上工作时QueryUnload事件。下面是场景。
示例:我有一个ParentForm,它是一个MDIChild和一个DialogForm(vbModal),用于填充某些字段的输入。请注意DialogForm 不是MDIChild
在VB3.0中
加载ParentForm并单击添加按钮。它将为用户的输入加载/显示DialogForm。
用户点击DialogForm上的取消按钮。它会卸载。请注意,此处没有Form_Unload事件。
用户单击ParentForm上的关闭按钮,首先触发ParentForm的Form_Unload事件,并触发DialogForm的Form_QueryUnload事件。
然而在VB6.0中它的不同如下所示
VB6.0
加载ParentForm并点击添加按钮。它将为用户的输入加载/显示DialogForm。
用户点击DialogForm上的取消按钮。它将消失但是Form_QueryUnload事件被触发。
ParentForm的Form_Unload事件根本不会触发。
请告诉我是否有任何事件问题在这里?我甚至提到了VB3.0和VB6.0的帮助文件,但两者都提到了相同的语句,没有区别。
请让我知道如何实现类似于VB3.0的事件流程在VB6.0
问候,
Hi All,
I have noticed a strange problem in the Form Unload & QueryUnload events while working on VB3 and VB6. Below is the scenario.
Example: I have a ParentForm which is a MDIChild and a DialogForm (vbModal) used to populate some fields for inputs. Please note DialogForm is not a MDIChild
In VB3.0
ParentForm is loaded and on click of a Add Button. It will load / show the DialogForm for inputs from the user.
User clicks a Cancel Button on DialogForm. It will unload. Note there is not Form_Unload event here.
User clicks a Close Button on ParentForm, the ParentForm's Form_Unload event is fired first, and the DialogForm's Form_QueryUnload event is fired.
However in VB6.0 its different as below
VB6.0
ParentForm is loaded and on click of a Add Button. It will load / show the DialogForm for inputs from the user.
User clicks a Cancel Button on DialogForm. It will disappear but the Form_QueryUnload event is triggered.
The ParentForm's Form_Unload event will not trigger at all.
Please let me know whether there is any problem here? I even referred to VB3.0 and VB6.0 help files but both mention the same statements with no differences.
Please let me know how i can achieve the event flow similar to VB3.0 in VB6.0
Regards,
这篇关于VB3与VB6形式事件触发问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!