再探MFC(六)状态栏
来源:互联网 发布:知有陈迹而不知有今务 编辑:程序博客网 时间:2024/06/03 01:41
状态栏使用
step1
对话框添加变量
// 状态栏对象
CStatusBarm_wndStatusBar;
step2
定义状态栏各Indicator资源ID
例如
Resource.h
#defineID_CALL_STATUS 32783
step3
OnInitDialog调用
//创建和初始化状态栏
BOOLCLBDKFODlg::CreateStatusBar()
{
static UINT nIndicators[] = {
ID_CALL_STATUS
};
if (!m_wndStatusBar.Create (this))
return FALSE;
m_wndStatusBar.SetIndicators (nIndicators,1);
CRectrect;
GetClientRect(&rect);
m_wndStatusBar.SetPaneInfo(0,ID_CALL_STATUS,SBPS_NORMAL,rect.Width());
//m_wndStatusBar.GetStatusBarCtrl().SetBkColor(RGB(180,180,180));
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,ID_CALL_STATUS);
return TRUE;
}
step4
更新状态栏文本
m_wndStatusBar.SetPaneText(0,"空闲");
Tocreate a status bar, follow these steps:
- Construct the CStatusBar object.
- Call the Create (or CreateEx) function to create the status-bar window and attach it to the CStatusBar object.
- Call SetIndicators to associate a string ID with each indicator.
There are three ways to update the text in a status-bar pane:
- Call CWnd::SetWindowText to update the text in pane 0 only.
- Call CCmdUI::SetText in the status bar's ON_UPDATE_COMMAND_UI handler.
- Call SetPaneText to update the text for any pane.
源文档 <https://msdn.microsoft.com/en-us/library/fha3tfk7.aspx>
参考资料
CStatusBarin CDialog, SetPaneText and CTime,GetCurrentTime with VC++ Sample
- 再探MFC(六)状态栏
- MFC框架界面开发(六):菜单、工具栏及状态栏
- MFC 状态栏
- MFC 状态栏
- MFC--状态栏
- MFC中的状态栏编程
- MFC状态栏编程
- MFC状态栏编程
- MFC工具条和状态栏
- MFC工具条和状态栏
- MFC状态栏显示时间
- MFC状态栏编程
- MFC工具条和状态栏
- MFC工具条和状态栏
- MFC修改状态栏
- MFC对话框添加状态栏
- MFC 状态栏添加新窗口
- MFC状态栏的编程
- u-boot中的text、bss、data和rodata区别和联系
- leetcode:Reverse Bits
- UDX进行中转模式解析
- MySQL日期数据类型、时间类型使用总结
- postgresql数据简单实用技巧
- 再探MFC(六)状态栏
- 网络蜘蛛爬虫 Scrapy - 简介&Demo
- ANDROID_HOME is not set and "android" command not
- C/C++使用ODBC连接Microsoft SQL server数据库
- 自定义类加载器卸载后重新加载类 static 再次调用
- R软件中排序:sort(),rank(),order()
- arcgis10.1安装 desktop server sde安装网址
- 编程思想-复用类
- 单目录下多文件 makefile编写