在新线程中打开一个表单 [英] Open a form in new thread

查看:78
本文介绍了在新线程中打开一个表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个系统任务栏应用程序,它必须执行一些任务,例如对屏幕进行快照,复制文件,弹出消息等.对于弹出消息,由于弹出消息将其他任务挂起,因此我面临一些困难.消息已关闭.有关更多信息,请参考链接.

I have a system tray application which has to perform some tasks like taking snapshot the screen, copying file, popping up a message etc. For Popping of a message, I am facing some difficulty as the popup message keeps other tasks pending until the message is closed. Please refer to link for more info.

基本上,我想从现有表单中打开一个新表单.我不想关闭新表格来执行在旧表格上待处理的任务.

Basically I want to open a new form from the existing form. I do not want to to close the new form to perform the task being kept pending on old form.

可以使用线程吗?怎么做到呢?我想使用线程处理它.我尝试使用form.show,这是对我的问题的简单答案,但是由于我使用的是计时器,因此form.show()只会使表单永久加载.因此,任何有关线程的参考都将有所帮助.

Can it be done using thread? How can it be done? I want to handle it using threading. I tried using form.show which is the simple answer to my question but since I am using timer the form.show() just keeps the form loading forever. Hence any reference for thread would be helpful.

推荐答案

您无需多线程即可打开表单,并且在打开新表单时无需访问旧表单.只需使用myform.Show()而不是myform.Showdialog()

You don't need multithreading to open a form and be able to acces old form while the new form is open. Just display the new form with myform.Show() instead of myform.Showdialog()

这篇关于在新线程中打开一个表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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