事件中断另一个事件

编程入门 行业动态 更新时间:2024-10-09 08:31:22
本文介绍了事件中断另一个事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在做一个项目,我想要做的是,当用户单击按钮开始处理一些较长的程序时,而用户可以随时停止此程序,而我正在寻找的是触发另一个取消时触发事件,一旦触发取消事件将停止流程按钮事件,就有可能获取触发事件并将其停止.如果有任何建议,欢迎问候,请先谢谢.

I am working on a project what I want to do is when the use click a button to start processing some long procedure, while that the user able to stop this procedure at any time, what I am looking for is to fire another event on cancel, once the cancel event fired is to stop the process button event, is it possible to get the firing event and stop it. please if any one has a suggestion it is greeting and welcome, thank you in advance.

推荐答案

您可以使用BackgroundWorker实现您正在说的内容. 请参见下面的链接, MSDN on Background worker with example [ ^ ] BackgroundWorker线程和支持取消 [ ^ ] 希望它对您有用, 谢谢. Hi, What you are talking can be fulfill using BackgroundWorker. Please see below links, MSDN on Background worker with example[^] BackgroundWorker Threads and Supporting Cancel[^] Hope it works for you, Thanks.

更多推荐

事件中断另一个事件

本文发布于:2023-11-28 04:08:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1640898.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:事件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!