多线程创建问题 [英] Multithreading creating problem

查看:82
本文介绍了多线程创建问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果在MDI应用程序中我有多个表单,并且想使用多线程同时运行多个子表单,那么重要的是拥有不同的对象名和变量名,因为所有表单都使用同一类的成员.

请帮助

解决方案

否,因为每个表单/类都具有自己的状态和数据,因此不需要.


<您可能在单独的工作线程中开始了冗长的操作(例如,使用后台工作程序).然后使用ShowDialog()显示表单,并在线程完成后关闭正在显示的对话框.


If in an MDI application I am having multiple forms and wanna run multiple child forms at same time asynchronously using multi-threading then, is it important to have distinct object names and variable name as all forms are using member of same classes.

please help

解决方案

No it is not needed as each form/class has it''s own state and data within it.


You probably start your lenthy operation in a separeate worker thread (e.g. using a background worker). Then show your form using ShowDialog() and on completion of the thread close the dialog you are showing.


这篇关于多线程创建问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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