利用BCGControlBar 实现状态条显示Progressbar

http://www.bcgsoft.com/featuretour/tour144.htm

 

Enhanced Status Bar

The library includes an advanced status bar control, which replaces the standard MFC status bar. It allows you to add animation, text or progress bar to your status bar pane quickly. The status bar comes with the following features:
  • Status bar pane progress bar
  • Status bar pane images, animations and text strings
  • Custom foreground/background pane color (status bar "skin")
  • Mouse events notification (mouse double click handling)

statusbar.jpg
Sample code:
CBCGStatusBar   m_wndStatusBar;
CBitmap         m_bmpStatusBarIcon;

static UINT indicators[] =
{
    ID_INDICATOR_ICON,      // status icon
    ID_SEPARATOR,           // status line indicator
    ID_INDICATOR_PROGRESS,  // progress bar
    ID_INDICATOR_LABEL,     // text label
    ID_INDICATOR_ANIMATION, // animation pane
    ID_INDICATOR_CAPS,
    ID_INDICATOR_NUM,
    ID_INDICATOR_SCRL,
};

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
    ...

    // Create status bar control:
    if (!m_wndStatusBar.Create(this) ||
        !m_wndStatusBar.SetIndicators(indicators,
          sizeof(indicators)/sizeof(UINT)))
    {
        TRACE0("Failed to create status bar\n");
        return -1;      // fail to create
    }

    // Set pane image:
    m_bmpStatusBarIcon.LoadBitmap (IDB_STATUS);
    m_wndStatusBar.SetPaneIcon (0, m_bmpStatusBarIcon);

    // Set pane progress:
    m_wndStatusBar.EnablePaneProgressBar (1, PROGRESS_MAX);
}

void CMainFrame::OnTimer (UINT nIDEvent)
{
    m_wndStatusBar.SetPaneProgress (1, m_nProgressCurr);
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值