problem with a second DIALOGBAR
-
hello i work on MFC project SDI,and i have add to my window a new DIALOGBAR ,and i want to add in it some control like slider and button but i have a problem how i can get message from a slider because the new DIALOGBAR is child and not main and one of this problem is: when i add slider and one EditBox and i want to watch the progression number of the slider in the Edit no thing happned. can you help me please?????
-
hello i work on MFC project SDI,and i have add to my window a new DIALOGBAR ,and i want to add in it some control like slider and button but i have a problem how i can get message from a slider because the new DIALOGBAR is child and not main and one of this problem is: when i add slider and one EditBox and i want to watch the progression number of the slider in the Edit no thing happned. can you help me please?????
Hi, Because the dialogbar is a child, you have to catch the message from the slider control into the parent window. You have to catch the slider message with onHScroll() or onVScroll(). So into your parent window (probably the mainframe) you can put into your mainframe.h: CSliderCtrl myslider; and void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); into your mainframe.cpp DDX_Control(pDX, IDC_MYSLIDER, myslider); ON_WM_HSCROLL() and void mainframe::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { CSliderCtrl* slider = (CSliderCtrl*) pScrollBar; int position = slider->GetPos(); OnHScroll(nSBCode, nPos, pScrollBar); } so after having the position, you can put the value into the edit box. It's up to you from now bye Everything's beautiful if you look at it long enough...
-
Hi, Because the dialogbar is a child, you have to catch the message from the slider control into the parent window. You have to catch the slider message with onHScroll() or onVScroll(). So into your parent window (probably the mainframe) you can put into your mainframe.h: CSliderCtrl myslider; and void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); into your mainframe.cpp DDX_Control(pDX, IDC_MYSLIDER, myslider); ON_WM_HSCROLL() and void mainframe::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { CSliderCtrl* slider = (CSliderCtrl*) pScrollBar; int position = slider->GetPos(); OnHScroll(nSBCode, nPos, pScrollBar); } so after having the position, you can put the value into the edit box. It's up to you from now bye Everything's beautiful if you look at it long enough...
-
Hi, Because the dialogbar is a child, you have to catch the message from the slider control into the parent window. You have to catch the slider message with onHScroll() or onVScroll(). So into your parent window (probably the mainframe) you can put into your mainframe.h: CSliderCtrl myslider; and void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); into your mainframe.cpp DDX_Control(pDX, IDC_MYSLIDER, myslider); ON_WM_HSCROLL() and void mainframe::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { CSliderCtrl* slider = (CSliderCtrl*) pScrollBar; int position = slider->GetPos(); OnHScroll(nSBCode, nPos, pScrollBar); } so after having the position, you can put the value into the edit box. It's up to you from now bye Everything's beautiful if you look at it long enough...