Application.Run()是"Begins running a standard application message loop on the current thread, and makes the specified form visible." 用代码可以表示为:
while(GetMessage(&msg)>0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
执导受到WM_QUIT,退出应用程序。而使用Form.Show()方法则Form显示后就立刻退出程序。如果用Form.ShowDialog()是模化对话框所以不会立刻消失,但是如果您还有其他窗口,Form.ShowDialog()显示的是模态窗口,只有它退出,其他窗口才能显示,但是一旦退出整个程序就推出,其他窗口将永不会得到运行机会,而用Application.Run()就不会出现这种现象。

相关文章:

  • 2021-10-24
  • 2021-09-08
  • 2021-09-10
  • 2021-12-24
  • 2021-12-26
  • 2022-02-14
  • 2022-12-23
  • 2021-05-10
猜你喜欢
  • 2022-01-15
  • 2021-08-24
  • 2021-11-17
  • 2022-12-23
  • 2021-12-10
  • 2022-03-10
相关资源
相似解决方案