开发者

What is the equivalent of End (VB6/VBA) in order to end in C# for Windows applications?

开发者 https://www.devze.com 2022-12-16 01:37 出处:网络
What is the equivalent o开发者_如何学运维f End (VB6/VBA) in order to end an application using C#?The marked answer is not correct.Application.Exit() is a graceful shutdown, it can be blocked by a form

What is the equivalent o开发者_如何学运维f End (VB6/VBA) in order to end an application using C#?


The marked answer is not correct. Application.Exit() is a graceful shutdown, it can be blocked by a form's FormClosing event handler setting e.Cancel = true. The exact equivalent to the VB End statement is Environment.Exit(0);


To terminate Windows Forms application use:

Application.Exit();

To terminate a console application you must return the main function.

0

精彩评论

暂无评论...
验证码 换一张
取 消