Click here to Skip to main content
15,921,295 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm a new one in MFC!
Forgive me for my English.
My question is : i used two slides control and two edit controls to display value of two slides. But when i drag slides, and then only one edit control can display value! :((
please help me! Thank you so much!
Posted

A little bit of code would make it easier to answer.

What kind of slider do you use, vertical or horizontal?

Look for OnHScroll() and/or OnVScroll() event handler and how they work.

[edit]
1st: Don't answer questions to your post, edit your question instead to insert additional information. Or add a new message to the message board on the bottom of site.

2nd: When you have one slider working, give us this code (add it to your question) so somebody can tell you what is wrong and why the second slider doesn't work.
 
Share this answer
 
v2
i have answer for my problem! This is a code

////////////////////////////////////////////////////////
void CHSIBasedDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
if(pScrollBar->;GetDlgCtrlID() == IDC_SLIDER1 && nSBCode == SB_THUMBPOSITION)
{
m_Edit1.Format("%1d",nPos);
UpdateData(false);
}
else if(pScrollBar->;GetDlgCtrlID() == IDC_SLIDER2 && nSBCode == SB_THUMBPOSITION)
{
m_Edit2.Format("%1d",nPos);
UpdateData(false);
}
else if(pScrollBar->t;GetDlgCtrlID() == IDC_SLIDER3 && nSBCode == SB_THUMBPOSITION)
{
m_Edit3.Format("%1d",nPos);
UpdateData(false);
}

else CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}


Thank you!
 
Share this answer
 
THanks stebich.
But i used two horizontal slider. And if i used three or four slider, how to work with OnHScroll() and/or OnVScroll().
Please guide me more detail.

Sincerely,...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900