tags:

views:

44

answers:

2

i have made the slider control in c++ using MFC. there is my code.

void CImageAnalyserDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{

 if(nSBCode == SB_THUMBPOSITION) 
 { 
 slidervalue.Format(_T("%d"), nPos);
 UpdateData(false);
 }
 else 
 { 
 CDialog::OnHScroll(nSBCode, nPos, pScrollBar); 
 } 
}

every thing is done, i just wanna know where should i write the implementaion of slider control, i mean where should i write this

if(slidervalue="10")
{
//do something
}
A: 

Please explain again. I doubt anyone can answer this question with the information given. What is 'slidervalue' and how does it relate to 'slidervalue1'?

Roel
sorry my mistake i edit it.
Sweety Khan
slidervalue is a string variable associated with an edit control. when i move slider it shows values from 0 - 100.
Sweety Khan
@Roel should i explain more?
Sweety Khan
someone is always ready here to down votes. Nice job!
Sweety Khan
A: 

Why would you want to put the slider position into a string and compare it at some other place in your code? In the OnHScroll handler, you already got the slider position. Do whatever you want to do in that function, or call some other function from the handler.

humbagumba