vc CStatusBar用法
//1 resource.h
#define ID_INDICATOR_TIP 1001
#define ID_INDICATOR_CLIENTNUM 1002
#define ID_INDICATOR_RUNTIME 1003
#define ID_INDICATOR_TIME 1004
//2 *.cpp 公共定义和声明
static UINT BASED_CODE indicators[] =
{
ID_INDICATOR_TIP,
ID_INDICATOR_CLIENTNUM,
ID_INDICATOR_RUNTIME,
};
CStatusBar m_bar;
//3 *.cpp OnInitDialog()
{
m_bar.Create(this);
m_bar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT));
m_bar.SetPaneInfo(0,ID_INDICATOR_TIP, SBPS_NORMAL,150);
m_bar.SetPaneInfo(1,ID_INDICATOR_CLIENTNUM, SBPS_NORMAL,150);
m_bar.SetPaneInfo(2,ID_INDICATOR_RUNTIME, SBPS_NORMAL,150);
m_bar.SetPaneText(1,"Welcome come here",TRUE); //set new pane1 text
m_bar.SetPaneText(2,"You can get a sweet felling",TRUE); //set new pane2 text
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,ID_INDICATOR_TIME);
}
本文介绍了vcCStatusBar的使用方法,包括资源文件中定义的状态栏指示器ID、初始化对话框中创建状态栏的过程及设置各面板的信息等。通过具体代码展示了如何设置文本和布局。
1万+

被折叠的 条评论
为什么被折叠?



