怎么判断拖动滚动条时的方向
1个回答
展开全部
void CDlgView::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
switch(nSBCode)
{
case SB_LINEUP:
case SB_LINEDOWN:
case SB_THUMBTRACK:
case SB_THUMBPOSITION:
case SB_PAGEUP:
case SB_PAGEDOWN:
m_nY = 0;
m_nY += nPos;
break;
default:
break;
}
Invalidate();
CScrollView::OnVScroll(nSBCode, nPos, pScrollBar);
TRACE(L"%d,%d\n", nSBCode,nPos);
}
{
switch(nSBCode)
{
case SB_LINEUP:
case SB_LINEDOWN:
case SB_THUMBTRACK:
case SB_THUMBPOSITION:
case SB_PAGEUP:
case SB_PAGEDOWN:
m_nY = 0;
m_nY += nPos;
break;
default:
break;
}
Invalidate();
CScrollView::OnVScroll(nSBCode, nPos, pScrollBar);
TRACE(L"%d,%d\n", nSBCode,nPos);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询