子框架状态栏显示/隐藏 [英] Child Frame Status Bar Show/Hide

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

问题描述

我正在使用VC ++ 2010开发,使用Ribbon Bar Office 2007样式的Fluent UI使用选项卡式文档的MDI应用程序。



我更改了主框架类中的CMFCRibbonStatusBar CMFCStatusBar (因为当框架尺寸小于文本时,右侧的扩展面板文本消失了 - CMFCStatusBar 状态栏只是截断了我需要的文字。)



我还有一个状态栏对于 CMFCStatusBar 的子框架。使用 ShowWindow(SW_SHOW / SW_HIDE)显示和隐藏此状态栏。显示/隐藏状态栏后,在使用调整大小条实际调整主框架大小之前,它不会在子框架中重新显示。



我尝试了几个显示/隐藏声明之后没有任何欢乐的事情:



I am developing using VC++ 2010, have an MDI application using tabbed documents using the Ribbon Bar Office 2007 style Fluent UI.

I changed the CMFCRibbonStatusBar to CMFCStatusBar in the Main Frame class (because the extended panel text on the right disappeared when the frame size became smaller than the text - the CMFCStatusBar status bar just truncates the text which is what I needed.)

I also have a status bar for the Child Frame that is a CMFCStatusBar. This status bar is shown and hidden using ShowWindow(SW_SHOW/SW_HIDE). After showing/hiding the status bar, it does not re-display in the child frame until you physically resize the main frame using the resize bars.

I have tried several things after the Show/Hide statement with no joy:

GetParentFrame()->RecalcLayout();
RecalcLayout(); (the child frame gives and unhandled exception because you are not supposed to resize the child frame when tabbed documents are used)
AfxGetMainWnd()->PostMessage(WM_SIZE, 0, 0);
AfxGetMainWnd()->Invalidate();
AfxGetMainWnd()->Redraw();





在VC ++ 6.0的旧时代,我们可以使用CStatusBar和 ShowControlBar()哪个效果很好!不幸的是,当你有Ribbon Bar时,CStatusBar类不起作用,所以我们必须使用 CMFCStatusBar 。 MFC版本没有相当于 ShowControlBar() ...



任何建议都会有所帮助!



In the old days of VC++ 6.0 we could use CStatusBar and ShowControlBar() which worked great! Unfortunately, the CStatusBar class does not work when you have the Ribbon Bar so we have to use CMFCStatusBar. The MFC version does not have an equivalent to ShowControlBar()...

Any suggestions would be helpful!

推荐答案

MSDN说你应该尝试 CBasePane: :ShowPane() [ ^ ]



此方法显示或隐藏窗格。使用此方法而不是ShowWindow,因为此方法会通知相关的停靠管理器有关窗格可见性的更改。
MSDN says you should try CBasePane::ShowPane()[^]

This method shows or hides a pane. Use this method instead of ShowWindow because this method notifies the relevant docking managers about changes in the pane's visibility.


您还可以改变职位 [ ^ ]框架的组件,

所以位置矩形为一个条形/视图/ ..可以有它的高度= 0或不... ...)
You can also change the positions[^] of the frame's components,
so the position rectangle of a bar/view/.. could have its height =0 or not... :)


我最后通过在Show之后向ChildFrame发布WM_SIZE消息来使其工作/隐藏。



m_wndChildStatusBar.ShowWindow(SW_SHOW);

PostMessage(WM_SIZE);



感谢Niklas和Eugen的有用建议!
I ended up getting it to work by posting a WM_SIZE message to the ChildFrame just after the Show/Hide.

m_wndChildStatusBar.ShowWindow(SW_SHOW);
PostMessage(WM_SIZE);

Thank you Niklas and Eugen for your helpful suggestions!


这篇关于子框架状态栏显示/隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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