Lucress Carol
2012-04-11 11:57:00 UTC
Hi every one,
I can not figure out how i can increment the value of my slider
control in 0.01 step. What's happening is that the step seems to be
0.08 instead of 0.01
BOOL CTestDlg:: OnInitDialog()
{
...
m_Slider.SetRange(0,1000); // from 0 to 10
m_Slider.SetTicFreq(1);
SetDlgItemText(IDC_SLIDER_VALUE, _T("0"));
}
void CTestDlg:: OnHScroll(UINT nSBCode, UINT nPos, CScrollBar*
pScrollbar)
{
m_SliderValue.Format(_T("%.2f"),(m_Slider.GetPos())*0.01);
SetDlgItemText(IDC_SLIDER_VALUE, m_SliderValue);
}
Could someone tell me what i'm overlooking ?
Thank you
I can not figure out how i can increment the value of my slider
control in 0.01 step. What's happening is that the step seems to be
0.08 instead of 0.01
BOOL CTestDlg:: OnInitDialog()
{
...
m_Slider.SetRange(0,1000); // from 0 to 10
m_Slider.SetTicFreq(1);
SetDlgItemText(IDC_SLIDER_VALUE, _T("0"));
}
void CTestDlg:: OnHScroll(UINT nSBCode, UINT nPos, CScrollBar*
pScrollbar)
{
m_SliderValue.Format(_T("%.2f"),(m_Slider.GetPos())*0.01);
SetDlgItemText(IDC_SLIDER_VALUE, m_SliderValue);
}
Could someone tell me what i'm overlooking ?
Thank you