发布网友 发布时间:2022-04-23 04:23
共1个回答
热心网友 时间:2023-09-28 15:57
void CTtttDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
int pos = m_slider.GetPos();
switch (nSBCode)
{
case SB_LINELEFT:
pos--;
break;
case SB_LINERIGHT:
pos++;
break;
}
if (pos < 0)
{
pos = 0;
}
if (pos > 100)
{
pos = 100;
}
m_slider.SetPos(pos);
CString str;
str.Format("%d", pos);
m_test.SetWindowText(str);
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}