nbsp; CWnd::OnVScroll(nSBCode, nPos, pScrollBar);
return ;
}
switch(nSBCode)
{
// case SB_BOTTOM://Scroll to bottom.
// case SB_ENDSCROLL://End scroll.
case SB_LINEDOWN://Scroll one line down.
{
RECT rc;
LOGFONT logFont;
CFont * pFont;
GetClientRect(&rc);
pFont = m_pComboBox->GetParent()->GetFont();
pFont->GetLogFont(&logFont);
ASSERT(logFont.lfHeight != 0);
if(logFont.lfHeight < 0) logFont.lfHeight = -logFont.lfHeight;
rc.left = (rc.bottom - rc.top) / logFont.lfHeight;
int nPos = GetScrollPos(SB_VERT) + 1;
if(nPos + rc.left <= m_aInfo.GetSize())
{
SetScrollPos(SB_VERT,nPos);
Invalidate();
}
}
break;
case SB_LINEUP://Scroll one line up.
{
int nPos = GetScrollPos(SB_VERT) - 1;
if(nPos >= 0)
{
SetScrollPos(SB_VERT,nPos);
Invalidate();
}
}
break;
case SB_PAGEDOWN://Scroll one page down.
{
RECT rc;
LOGFONT logFont;
CFont * pFont;
GetClientRect(&rc);
pFont = m_pComboBox->GetParent()->GetFont();
pFont->GetLogFont(&logFont);
ASSERT(logFont.lfHeight != 0);
if(logFont.lfHeight < 0) logFont.lfHeight = -logFont.lfHeight;
rc.top = rc.bottom / logFont.lfHeight;
int nPos = GetScrollPos(SB_VERT);
if(nPos < m_aInfo.GetSize() - rc.top)
{
nPos += rc.top;
if(nPos > m_aInfo.GetSize() - rc.top) nPos = m_aInfo.GetSize() - rc.top;
SetScrollPos(SB_VERT,nPos);
Invalidate();
}
}
break;
case SB_PAGEUP://Scroll one page up.
{
RECT rc;
LOGFONT logFont;
CFont * pFont;
GetClientRect(&rc);
pFont = m_pComboBox->GetParent()->GetFont();
pFont->GetLogFont(&logFont);
ASSERT(logFont.lfHeight != 0);
if(logFont.lfHeight < 0) logFont.lfHeight = -logFont.lfHeight;
rc.top = rc.bottom / logFont.lfHeight;
int nPos = GetScrollPos(SB_VERT);
if(nPos > 0)
{
nPos -= rc.top;
if(nPos < 0) nPos = 0;
SetScrollPos(SB_VERT,nPos);
Invalidate();
}
&nb