[英]How to display "Updating Workflow Status" progress bar in Excel status bar in VSTO?
There is no trivial way to customize the status bar with a progress bar...没有简单的方法可以使用进度条自定义状态栏...
The Application.StatusBar property allows setting a custom text in the status bar, but not a progress bar. Application.StatusBar属性允许在状态栏中设置自定义文本,但不能在进度栏中设置。 This property returns
false
if Microsoft Excel has control of the status bar.如果 Microsoft Excel 控制了状态栏,则此属性返回
false
。 To restore the default status bar text, set the property to false
- this works even if the status bar is hidden.要恢复默认状态栏文本,请将属性设置为
false
- 即使隐藏状态栏也可以使用。
oldStatusBar = Application.DisplayStatusBar
Application.DisplayStatusBar = True
Application.StatusBar = "Please be patient..."
Workbooks.Open filename:="LARGE.XLS"
Application.StatusBar = False
Application.DisplayStatusBar = oldStatusBar
If you want to display a progress bar with some text I'd suggest using task panes for that.如果您想显示带有一些文本的进度条,我建议您使用任务窗格。 Read more about that in the How to: Add a custom task pane to an application article.
在如何:将自定义任务窗格添加到应用程序一文中了解更多信息。 On the user control you are free to use any .net controls.
在用户控件上,您可以自由使用任何 .net 控件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.