CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 1999
    Posts
    3

    Cut and Copy in EDIT Control

    I'm using MSVC 5.0. When i build a new project with a FormView and put a edit control to the form, i can't use the cut (Ctrl+X), copy (Ctrl+C) and paste (Ctrl+V) commands. What's the problem


  2. #2
    Join Date
    Apr 1999
    Location
    Toronto, ON
    Posts
    713

    Re: Cut and Copy in EDIT Control

    If you can do it by right-mouse click there is nothing wrong.
    In this case you just need to create accelerator keys. Handle this case in your program.


    Good luck!

    Dmitriy, MCSE

  3. #3
    Join Date
    Sep 1999
    Posts
    3

    Re: Cut and Copy in EDIT Control

    OK, I can do it by right mouse click.
    But how can I handle the accelerator keys?
    And why put MS this nice EDIT command into the menu and do not support handling of this commands in a standard edit control?

    Thanx for your answer
    sts


  4. #4
    Join Date
    Apr 1999
    Location
    Toronto, ON
    Posts
    713

    Re: Cut and Copy in EDIT Control

    Open your resource view in your workspace. I think you nave there Accelerator resource, if no insert it and create ID_EDIT_PASTE with keys control/C.
    Goto ClassWizard.
    Select your CMainFrame class in right combobox, or CYourDialog class if you in dialog-Based app.
    Select on the left side ID_EDIT_PASTE, select COMMAND in messages. Then Add function.
    For example you have OnEditPaste function.
    In body of this function:
    void CMainFrame::OnEditPaste()
    {
    CCommentsFrame* pWnd=(CCommentsFrame*)this->GetActiveWindow();
    pWnd->m_pedtView->SendMessage(WM_PASTE);

    }
    //CCommentsFrame - it is frame for my editview


    Good luck!

    Dmitriy, MCSE

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