Click to See Complete Forum and Search --> : EN_VSCROLL
Daniel Canham
July 28th, 1999, 10:06 AM
EN_VSCROLL does not work when the Control is a CRichEditCtrl class.
I need to be able to link the v-scrollbars of two CRichEditCtrl's together.
How do you enable the message map EN_VSCROLL in CRichEditCtrl?
if that is impossible is there an equivalent message map? How do I execute a f() when the user moves the v-scrollbar?
Septimiu
July 30th, 1999, 02:49 AM
you have to implement the ON_NOTIFY function:
/ccode
//in *.cpp file :
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)
//{{AFX_MSG_MAP(CMyDlg)
ON_NOTIFY(EN_MSGFILTER, IDC_RICH, OnMsgfilterRich)
[......]//other messages
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//where IDC_RICH is declared in resource.h and the OnMsgfilterRich is declared below:
void CMyDlg::OnMsgfilterRich(NMHDR* pNMHDR, LRESULT* pResult)
{
MSGFILTER *pMsgFilter = reinterpret_cast<MSGFILTER *>(pNMHDR);
if(pMsgFilter->msg==WM_VSCROLL)
{
AfxMessageBox("scroll was used")
}
*pResult = 0;
}
//for this function being enable you have to send a message to the end of OnInitDialog() function:
BOOL CMyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
[...]//other declarations
::SendMessage(m_Rich, EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS|ENM_SCROLLEVENTS);
}
//where m_Rich is the richeditctrl control.
//in the *.h file you have:
afx_msg void OnMsgfilterRich(NMHDR* pNMHDR, LRESULT* pResult);
/ccode
that is. I hope it helps you!
Septimiu
Daniel Canham
July 30th, 1999, 07:22 PM
thanks, we'll give it a try!!
aamirdogar
July 31st, 1999, 01:33 AM
hi,
please help me i am trying to implement scrolling when i am using CScrollView as the base class.
How can i implement scrolling.
Daniel Canham
July 31st, 1999, 11:16 AM
what type of scrolling?? this question concerned scroll linking two richedit edit boxes together. What exactly are you trying to do??
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.