Click to See Complete Forum and Search --> : Cut and Copy in EDIT Control


sts
September 8th, 1999, 02:55 PM
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

Dmitriy
September 8th, 1999, 08:34 PM
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

sts
September 9th, 1999, 04:16 AM
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

Dmitriy
September 9th, 1999, 08:40 AM
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