· Add the following code to the void CColourChangerDlg::OnHScroll method to read the
scrollbar value into the edit boxes and into the three variables, n_red, n_green and
n_blue.
void CColourChangerDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar*
pScrollBar)
{
if(nSBCode == SB_THUMBPOSITION)
{
if (pScrollBar == &m_slide1){
m_text1.Format("%ld", nPos);
UpdateData(false);
n_red = nPos; }
if (pScrollBar == &m_slide2){
m_text2.Format("%ld", nPos);
UpdateData(false);
n_green = nPos;}
if (pScrollBar == &m_slide3){
m_text3.Format("%ld", nPos);
UpdateData(false);
n_blue = nPos;}
}
else
{
CDialog::OnHScroll(nSBCode, nPos,
pScrollBar);
}
}
No comments:
Post a Comment