如何设置状态栏的位置?

wanghugo 2005-08-18 12:37:42
我只知道RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,ID_STATUS_BAR)是设置状态栏在对话框的底部。
但是我是想知道一下如何设置到任何位置?
我尝试过 sxdddddddd用SetWindowPos(),运行通过但是状态条显示不出来!!!
WHY?
...全文
283 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lixiaosan 2005-08-18
  • 打赏
  • 举报
回复
http://www.codeproject.com/dialog/statusbarmsgwnd.asp
bager 2005-08-18
  • 打赏
  • 举报
回复
创建状态栏时,使用CBRS_TOP属性,可以设置状态栏在对话框的顶部。
调用状态栏控件类的SetMinHeight可设置状态栏的高度。如下:
m_wndStatusBar.GetStatusBarCtrl().SetMinHeight(80);

对于如何设置在其他位置及任意尺寸显示暂时没有办法,如下MSDN的说明

Settings for the CStatusBarCtrlSee Also

The default position of a CStatusBarCtrl status window is along the bottom of the parent window, but you can specify the CCS_TOP style to have it appear at the top of the parent window's client area.

You can specify the SBARS_SIZEGRIP style to include a sizing grip at the right end of the CStatusBarCtrl status window. A sizing grip is similar to a sizing border; it is a rectangular area that the user can click and drag to resize the parent window.

Note If you combine the CCS_TOP and SBARS_SIZEGRIP styles, the resulting sizing grip is not functional even though the system draws it in the status window.
The window procedure for the status window automatically sets the initial size and position of the control window. The width is the same as that of the parent window's client area. The height is based on the metrics of the font that is currently selected into the status window's device context and on the width of the window's borders.

The window procedure automatically adjusts the size of the status window whenever it receives a WM_SIZE message. Typically, when the size of the parent window changes, the parent sends a WM_SIZE message to the status window.

You can set the minimum height of a status window's drawing area by calling SetMinHeight, specifying the minimum height in pixels. The drawing area does not include the window's borders.

You retrieve the widths of the borders of a status window by calling GetBorders. This member function includes the pointer to a three-element array that receives the width of the horizontal border, the vertical border, and the border between rectangles.

pomelowu 2005-08-18
  • 打赏
  • 举报
回复
试试MoveWindow
wanghugo 2005-08-18
  • 打赏
  • 举报
回复
跟我的要求不相关啊

16,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧