是否有一个code ++模板/设计模式,我可以用反应鼠标点击或按键presses什么时候? [英] Is there a code template/design pattern I can use when reacting to mouse clicks or button presses?

查看:111
本文介绍了是否有一个code ++模板/设计模式,我可以用反应鼠标点击或按键presses什么时候?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个问题,我经常用的WinForms应用程序看到的是,虽然长期运行的任务正在运行或只是简单的停止刷新GUI线程被卡住(是的,我知道 - 需要线程)。

One of the problems that I constantly see with Winforms applications is that the GUI thread is stuck while a long-running task is running or just plain stops refreshing (yes, I know - needs threading).

有没有code ++模板/设计模式,我可以用反应鼠标点击或按键presses什么时候?如果有一个处理线程一直在GUI应用程序运行?

Is there a code template/design pattern I can use when reacting to mouse clicks or button presses? Should there be a processing thread always running in the GUI app?

基本上,我怎么写一个伟大的WinForms应用程序,易于维护,没有任何奇特刷新错误?

Basically, how do I write a great Winforms Application that is easy to maintain and doesn't have any quirky refresh bugs?

推荐答案

BackgroundWorker的

这篇关于是否有一个code ++模板/设计模式,我可以用反应鼠标点击或按键presses什么时候?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆