Application.ExitThread,Application.Exit的区别
Application.ExitThread,Application.Exit的区别
扫一扫加微信
Application.Exit方法:
通知所有消息泵必须终止,处理完所有窗口消息,并关闭应用程序所有窗体后关闭程序。
Informs all message pumps that they must terminate, and then closes all application
windows after the messages have been processed.
调用Application.Exit方法,系统会通知当前程序所有已打开的页面,以及处理Form.Closing事件,该方法受CancelEventArgs参数影响,若Cancel=True,Application.Exit无法关掉程序。
Application.ExitThread 方法:
退出当前线程上的消息循环,并关闭该线程上的所有窗口(强制关闭程序)。不受CancelEventArgs参数影响。
Exits the message loop on the current thread and closes all windows on the thread.
扫一扫加微信
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网