Parag Bhogte
July 17th, 1998, 04:35 PM
I am using CFormView as a base View class. I have dragged several controls on the "form" and therefore, the horizontal and vertical scroll bars are added automatically by the application. Unfortunately, I have also added a 'slider control' in the form and to take care of that slider control, I had to write "OnHScroll" message handler. It goes as follows:
void CSampleView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
CSliderCtrl* slider = (CSliderCtrl*)pScrollBar;
int position = slider->GetPos();
SetDlgItemInt(IDC_VALUE, position);
CFormView::OnHScroll(nSBCode, nPos, pScrollBar);
}
Here, IDC_VALUE is the control id of one of the Edit controls. The slider control is working fine. But whenever I move the horizontal scroll bar added by the application, the aplication hangs up. I know, I should do something regarding the OnHScroll function. But, I don't know what to do. Can you help me?
Parag
void CSampleView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
CSliderCtrl* slider = (CSliderCtrl*)pScrollBar;
int position = slider->GetPos();
SetDlgItemInt(IDC_VALUE, position);
CFormView::OnHScroll(nSBCode, nPos, pScrollBar);
}
Here, IDC_VALUE is the control id of one of the Edit controls. The slider control is working fine. But whenever I move the horizontal scroll bar added by the application, the aplication hangs up. I know, I should do something regarding the OnHScroll function. But, I don't know what to do. Can you help me?
Parag