更新状态栏 [英] Update StatusBar

查看:97
本文介绍了更新状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单的方法来获取当前应用程序的状态栏并更新其文本?

Is there an easy way to get the current application''s status bar and update it''s text?

推荐答案

不,没有简单易行的方法一般的方法.您将需要保留对状态栏的全局引用(使用静态变量或其他任何内容).这取决于您的应用程序模型如何实现.

还请记住,WPF中的状态栏只是用于容纳更多控件(例如TextBlocks等)的容器.
No, there is no easy and general way. You will need to keep a global reference to the status bar (using a static variable or whatever...). It depends on your application model how you will do it.

Also keep in mind that status bar in WPF is just a container for more controls (TextBlocks etc.).


对于任何应用程序,通常都没有办法,但是正如有人所说,如果当前的应用程序不是您的应用程序,WPF不提供任何连接到窗口并通过b/c对其进行控制的方式,只有一个窗口,即主窗口.也许您需要解释您想做什么?
There is no way in general, for any app, but as someone said, if the current application is not YOUR application, WPF does not provide ANY way of hooking in to windows and controlling them b/c there''s only one window, the main one. Perhaps you need to explain what you want to do ?


感谢您的回答和提示.在初始化StatusBar和TextBox组件之后,我设置了一些静态变量.
Thanks for the responses and hints. I made a couple static variables that I set after the StatusBar and TextBox components are initialised.


这篇关于更新状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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