Form.Show之后的代码 [英] Code after Form.Show

查看:58
本文介绍了Form.Show之后的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我使用VB6以来已经有一段时间了,所以如果这是愚蠢的话请跟我一起。如果我在函数中调用它,如何通过Form.show方法?这是场景。


Sub Whatever()

Its been a while since I worked with VB6, so hang with me if this is stupid. How do I get past the Form.show method if I call it in a function? Here is the scenario.

Sub Whatever()

这里的一些代码


frmProcess.Show vbModal


更多代码在这里
Some Code Here

frmProcess.Show vbModal

Some More Code Here

end sub


我希望它能够处理更多代码在这里表格显示后的部分。但它只显示表单并挂起,直到我关闭表单。然后它移动到Some More Code Here和Some More Code Here。一部分。


我试过移动Some More Code Here到frmProcess的形式负载。与之相关的是Some More Code Here。完成后,我不再需要表格了。所以把它放在表单加载上永远不会显示表单。


它就像我需要另一个线程或东西,但我不认为我能在VB6中做到这一点,对吧?


如何我可以只显示表单并继续吗?

end sub

I want it to process the "Some More Code Here" portion after the form is shown. But it just shows the form and hangs until I close the form. Then it moves onto the "Some More Code Here" portion.

I tried moving "Some More Code Here" to the form load of frmProcess. The thing with that is once "Some More Code Here" is done, then I don''t need the form up anymore. So putting it on form load never shows the form.

Its like I need another thread or something, but I don''t think I can do that in VB6, right?

How can I just display the form and move on?

推荐答案


自从我使用VB6以来已经有一段时间了,所以如果这是愚蠢的话,请和我一起。如果我在函数中调用它,如何通过Form.show方法?这是场景。


Sub Whatever()
Its been a while since I worked with VB6, so hang with me if this is stupid. How do I get past the Form.show method if I call it in a function? Here is the scenario.

Sub Whatever()
这里的一些代码


frmProcess.Show vbModal


更多代码在这里
Some Code Here

frmProcess.Show vbModal

Some More Code Here

end sub


我希望它能够处理更多代码在这里表格显示后的部分。但它只显示表单并挂起,直到我关闭表单。然后它移动到Some More Code Here和Some More Code Here。一部分。


我试过移动Some More Code Here到frmProcess的形式负载。与之相关的是Some More Code Here。完成后,我不再需要表格了。所以把它放在表单加载上永远不会显示表单。


它就像我需要另一个线程或东西,但我不认为我能在VB6中做到这一点,对吧?


如何我可以只显示表格并继续前进吗?

end sub

I want it to process the "Some More Code Here" portion after the form is shown. But it just shows the form and hangs until I close the form. Then it moves onto the "Some More Code Here" portion.

I tried moving "Some More Code Here" to the form load of frmProcess. The thing with that is once "Some More Code Here" is done, then I don''t need the form up anymore. So putting it on form load never shows the form.

Its like I need another thread or something, but I don''t think I can do that in VB6, right?

How can I just display the form and move on?



我现在正在数据库上使用此语句并且运行良好我没有发现此代码有任何问题。


现在使用这一个


Private Sub()


text1.text = 5(部分代码)

frm.Show

frm.text1.text = 5(更多代码)


结束子


尝试它,如果它不起作用然后我会发送你另一个解决方案。


I am using this statement now at this time on an database and is doing well i have not found any problem with this code.

Now use this one

Private Sub ()

text1.text=5 (Some code)
frm.Show
frm.text1.text=5 (Some more code)

End Sub

try it if it does not work then i will send u another solution.


阿里,


感谢您的回复。我试过那段代码。但是,如果我删除vbModal,我收到一个错误。这是你的建议吗?
Ali,

Thanks for the reply. I tried that code. However, if I remove "vbModal" I get an error. Is that what you were suggesting?



...如果我删除vbModal我收到错误...
... if I remove "vbModal" I get an error ...



您能否提供有关错误的更多详细信息,例如错误发生的位置?什么时候?


当你以模糊方式显示一个窗口时,这意味着它需要控制并且在卸载窗口之前不会返回它(我认为)隐藏。因此,除非(A)表格被隐藏/卸载,或(B)以非模态显示,否则你不能继续通过Show语句这一事实无法解决。 />

我认为可以做多个线程,但没有任何经验。但在这种情况下,这可能是不必要的。

Can you give us more detail on the error, such as where it occurs? And when?

When you show a window modally, that means it takes control and doesn''t return it until the window is unloaded or (I think) hidden. So there''s no getting around the fact that you cannot continue on past the Show statement unless (A) the form is hidden/unloaded, or (B) it is shown non-modally.

I think it is possible to do multiple threads, but don''t have any experience with them. It''s probably unnecessary in this case, though.


这篇关于Form.Show之后的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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