如何在文档查看器加载.Docx文件时将进度条附加到文档查看器 [英] How Do I Attach A Progress Bar To A Document Viewer When It Loads A .Docx File

查看:75
本文介绍了如何在文档查看器加载.Docx文件时将进度条附加到文档查看器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ProgressBar控件,我希望它在用户从组合框列表中选择要查看的文档时显示自己加载。而不是应用程序冻结,我希望它显示文档查看器加载的百分比的状态,直到它最终加载,然后进度条消失

I have a ProgressBar control, I want it to show itself loading when a user selects a document to be viewed from a combo box list. Instead of the application freezing, I want it to show the status of the percentage the document viewer is loading until it finally loads and then the progressbar dissapears

推荐答案

您可以使用BackgroundWorker类,它在您使用WPF时简化了后台线程的处理:



BackgroundWorker和ProgressBar演示 [ ^ ]





BackgroundWorker主题和支持取消 [ ^ ]
You can use the BackgroundWorker class, which simplifies the handling of background threads when you are working with WPF:

BackgroundWorker and ProgressBar demo[^]


BackgroundWorker Threads and Supporting Cancel[^]


这篇关于如何在文档查看器加载.Docx文件时将进度条附加到文档查看器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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