博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
再探MFC(六)状态栏
阅读量:4120 次
发布时间:2019-05-25

本文共 1080 字,大约阅读时间需要 3 分钟。

状态栏使用

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:

  1. Construct the CStatusBar object.
  2. Call the  (or ) function to create the status-bar window and attach it to the CStatusBar object.
  3. Call  to associate a string ID with each indicator.

There are three ways to update the text in a status-bar pane:

  1. Call  to update the text in pane 0 only.
  2. Call  in the status bar's ON_UPDATE_COMMAND_UI handler.
  3. Call  to update the text for any pane.

 

源文档 <>

 

 

参考资料

转载地址:http://awppi.baihongyu.com/

你可能感兴趣的文章
element-ui全局自定义主题
查看>>
facebook库runtime.js
查看>>
vue2.* 中 使用socket.io
查看>>
openlayers安装引用
查看>>
js报错显示subString/subStr is not a function
查看>>
高德地图js API实现鼠标悬浮于点标记时弹出信息窗体显示详情,点击点标记放大地图操作
查看>>
初始化VUE项目报错
查看>>
vue项目使用安装sass
查看>>
HTTP和HttpServletRequest 要点
查看>>
在osg场景中使用GLSL语言——一个例子
查看>>
关于无线PCB中 中50欧姆的特性阻抗的注意事项
查看>>
Spring的单例模式源码小窥
查看>>
后台服务的变慢排查思路(轻量级应用服务器中测试)
查看>>
MySQL中InnoDB事务的默认隔离级别测试
查看>>
微服务的注册与发现
查看>>
bash: service: command not found
查看>>
linux Crontab 使用 --定时任务
查看>>
shell编程----目录操作(文件夹)
查看>>
机器学习-----K近邻算法
查看>>
HBASE安装和简单测试
查看>>