gpt4 book ai didi

c# - C# 中的 Windows GUI 主循环...它在哪里?

转载 作者:太空狗 更新时间:2023-10-29 22:10:08 27 4
gpt4 key购买 nike

我有一个使用 C# 编写的 Windows 窗体应用程序,我正在尝试弄清楚我将在何处实现与 main() 中的主要 while 循环等效的 CLI 应用程序。我正在使用 Visual C# 的图形用户界面设计器。

编辑:使用 Timer 实例解决了问题。

最佳答案

它在 Application.Run 里面方法。您不应该直接调用 GetMessage API 函数:

// MyForm is derived from `System.Windows.Forms.Form` class
Application.Run(new MyForm());

关于c# - C# 中的 Windows GUI 主循环...它在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1364809/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com