CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 1999
    Location
    europe/ch
    Posts
    22

    copy/paste with edit control, HOW TO?

    Hi All,
    I should test the content of an edit.
    But I don't know how to catch the paste event from edit menu (right button mouse)

    With Ctrl+V, the CMyEdit::OnChar(...) method is called.
    But with the mouse this method is not called.

    Has anyboby an idea how to treat this event

    thanks
    oliver


  2. #2
    Join Date
    Apr 1999
    Posts
    22

    Re: copy/paste with edit control, HOW TO?

    Are you talking about a CEdit control? If so, maybe the EN_CHANGE event is triggered when this happens. Try handling that event for the control and call your check function in the handler.

    Best of luck,
    Chris

    "No! Try not. Do...or do not. There is no try."
    - Yoda, Jedi Master

  3. #3
    Join Date
    Apr 1999
    Location
    europe/ch
    Posts
    22

    Re: copy/paste with edit control, HOW TO?

    Hi Chris,
    Thanks for your answer.

    I already triggered this event in the CDialog that using a such CEdit.
    And when I implement the CEdit::OnChange, the CDialog is not notifyed by this event.
    So, how can I forwarding this event to the CDialog?

    Cheers
    oliver


  4. #4
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: copy/paste with edit control, HOW TO?

    Firstly, I notice you said 'CEdit::OnChange()' - just to clarify, are you aware that you should add a handler for EN_CHANGE to the dialogue box class itself, not attempt to add it to the edit control as a reflected message or anything like that?

    Secondly, I believe that both <Ctrl>V as a key combination and choosing Paste from the right-click menu result in WM_PASTE being sent TO THE EDIT CONTROL ITSELF. This means that you would need to derive your own class from CEdit and subclass the existing edit control, then handle the WM_PASTE message as required. If you want information on how to do this, e-mail me ([email protected]).



    --
    Jason Teagle
    [email protected]

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