| |

VerySource

 Forgot password?
 Register
Search
View: 639|Reply: 1

How does an IDC_SCROLLBAR1 interface with an integer in the interface?

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-2 09:40:02
| Show all posts |Read mode
How does an IDC_SCROLLBAR1 interface with an integer in the interface?
That is to say, how to find it in the upper part of the code can achieve this function.
Hope everyone tell me
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-3-22 10:15:01
| Show all posts
BOOL CT6ttDlg :: OnInitDialog ()
{
.............

// TODO: Add extra initialization here
m_scrollBar.SetScrollRange (0,100);
Ranch
return TRUE; // return TRUE unless you set the focus to a control
}

void CT6ttDlg :: OnVScroll (UINT nSBCode, UINT nPos, CScrollBar * pScrollBar)
{
// TODO: Add your message handler code here and / or call default
if (pScrollBar-> GetDlgCtrlID () == IDC_SCROLLBAR1)
{
int nCurrentPos = pScrollBar-> GetScrollPos ();
TRACE ("nCurrentPos =% d\n", nCurrentPos);
switch (nSBCode)
{
// case SB_THUMBTRACK:
case SB_THUMBPOSITION:
pScrollBar-> SetScrollPos (nPos);
break;
case SB_LINEUP:
pScrollBar-> SetScrollPos (nCurrentPos-1);
break;
case SB_LINEDOWN:
pScrollBar-> SetScrollPos (nCurrentPos + 1);
break;
case SB_PAGEUP:
pScrollBar-> SetScrollPos (nCurrentPos-5);
break;
case SB_PAGEDOWN:
pScrollBar-> SetScrollPos (nCurrentPos + 5);
break;
}
}
Ranch
CDialog :: OnVScroll (nSBCode, nPos, pScrollBar);
}
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list