执行程序后关闭当前表单,在C#中 [英] Close current form after execute a procee, in C#

查看:63
本文介绍了执行程序后关闭当前表单,在C#中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在我用c#设计的应用程序中,我想在我的表单中执行计算器。

但是当通过以下命令调用它时,当前表单将被关闭。 br />
流程ie = Process.Start(calc.exe);



如何执行此操作,以便当前表单保持打开状态?

非常感谢

Hi In my application which designed by c#, I want to execute calculator in my form .
But when it be called by following command, the current form will be closed.
Process ie = Process.Start("calc.exe");

How can I do this, so that current form remain open?
Thanks very much

推荐答案

问题是基于错误的观察。当你开始一个新的子进程时,当前表单是关闭的并不是真的。它不会。你没有什么可以做的。



当然,开始这个过程不会在你的表格中执行计算器。它将启动一个单独的过程,仅此而已。



开始一个单独的过程是一个坏主意,尤其是计算器。无论如何,你无法使用计算结果。许多用户在看到此类应用程序时都不会使用您的产品。在你的应用程序中提供一个计算器会好得多。



-SA
The question is based on false observation. It''s not true that the current form is closed when you start a new child process. It won''t. There is nothing you should do about it.

And of course starting this process won''t "execute calculator" in your form. It will start a separate process, nothing more.

Starting a separate process is really a bad idea, especially the Calculator. Anyway you won''t be able to use the results of the calculation. Many users won''t use your products when they see such application. It would be much better to provide a calculator inside your application.

—SA


这篇关于执行程序后关闭当前表单,在C#中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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