[ZZ]在MFC中有多个slider时OnHScroll函数判断方法

在OnHScroll开始时添加几个CWnd*变量,在和参数中pScrollBar判断就可以了

void CPlayerDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default

CWnd
*pSliderPos = this->GetDlgItem(IDC_SLIDER_POS);
CWnd
*pSliderVolume = this->GetDlgItem(IDC_SLIDER_VOLUME);
if (pScrollBar == pSliderVolume)
{
。。。 。。。

}
if (pScrollBar == pSliderPos)
{
。。。 。。。

}

CBitmapDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}



原帖地址:http://hi.baidu.com/ncudlz/blog/item/fba375dd6b6b74d18d1029d8.html

posted @ 2010-11-30 10:12  Chjun  阅读(802)  评论(0编辑  收藏  举报