CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: EN_VSCROLL

  1. #1
    Join Date
    Jun 1999
    Location
    Rochester, NY
    Posts
    45

    EN_VSCROLL

    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?


  2. #2
    Join Date
    Apr 1999
    Location
    romania
    Posts
    43

    Re: EN_VSCROLL

    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


  3. #3
    Join Date
    Jun 1999
    Location
    Rochester, NY
    Posts
    45

    Re: EN_VSCROLL

    thanks, we'll give it a try!!


  4. #4
    Join Date
    Jun 1999
    Location
    Pakistan
    Posts
    77

    Re: EN_VSCROLL

    hi,
    please help me i am trying to implement scrolling when i am using CScrollView as the base class.

    How can i implement scrolling.


  5. #5
    Join Date
    Jun 1999
    Location
    Rochester, NY
    Posts
    45

    Re: EN_VSCROLL

    what type of scrolling?? this question concerned scroll linking two richedit edit boxes together. What exactly are you trying to do??


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured