English 中文(简体)
当形式关闭时,我如何杀死一个视窗移动电话6。
原标题:How do I kill a Windows Mobile 6.1 forms app process when the form is closed?

在F.Net CF 3.5 WinForms方案I ve书写的节目中,我通过在表格1的新实例发出信号。

Application.Run(new Form1());

当我想要结束申请时,我凌驾于形式1的闭门活动之上,以便我能够确保撤销申请。

// In Form1 code-behind
private void OnFormClosed(object sender, EventArgs e)
{
    Application.Exit(); // Doesn t kill process
}

当这部法典实施时,我想要从屏幕上消失,我希望它所展开的进程会消失。 app(消失),但不幸的是,这一进程(我们称之为它)仍然无限期地进行。 当我再次开始并关闭时,它又产生了另一个 app头。 因此,这一进程永远不会消失,而且正在创造更多的记忆。

我怎么能确保这一进程在我关闭/撤出时遭到杀害? 感谢。

最佳回答

首先,你们不应被迫在被关闭的场面上 over倒,以恢复你们的行为。 就在申请中通过表格。 滚动将使电灯泵退出should。 导致这一进程结束。 视窗 移动式您应当将表格中的财产定在false上,以防止其仅被尽量减少——你应当拥有(K)上的权利,而不是(X)。

如果这一表格结束时,这一过程就没有结束,那么,99.99%的时间是,你有一只工人的read子,仍在阻止这一进程结束。 确保你们的所有人 读物有IsBackground set to true(CF 3.5),作为防范措施,所有你的胎面也应有某种形式的出境通知或旗帜。 不要依赖终止这一进程,以压倒你们。

问题回答

你的问题是,你有<条码>。 表格:MinimizeBox = 真实。 将标题改为false,表格为losong>/strong>,在x >被点击时改为minimized<>>。

在你看来还有更多事情要做:

表格1

  • There is no FormClosed event for forms of type System.Windows.Forms.Form, only Closing and Closed.
  • You don t override an event. You override a virtual function from a base class or interface.




相关问题
Bring window to foreground after Mutex fails

I was wondering if someone can tell me what would be the best way to bring my application to the foreground if a mutex was not able to be created for a new instance. E.g.: Application X is running ...

How to start WinForm app minimized to tray?

I ve successfully created an app that minimizes to the tray using a NotifyIcon. When the form is manually closed it is successfully hidden from the desktop, taskbar, and alt-tab. The problem occurs ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

Handle DataTable.DataRow cell change event

I have a DataTable that has several DataColumns and DataRow. Now i would like to handle an event when cell of this DataRow is changed. How to do this in c#?

Apparent Memory Leak in DataGridView

How do you force a DataGridView to release its reference to a bound DataSet? We have a rather large dataset being displayed in a DataGridView and noticed that resources were not being freed after the ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

WPF-XAML window in Winforms Application

I have a Winforms application coded in VS C# 2008 and want to insert a WPF window into the window pane of Winforms application. Could you explain me how this is done.