DJ_AM_Juicebox
asked on
keyboard shortcuts for CEdit
Hi,
I have a standard CDialog derived class with some CEdits on it. When I right click one of the edit controls, I get the standard copy/cut/paste menu, and it works fine.
What doesn't work is if I have the edit control hilighted and use the keyboard shortcut ctrl + c. (shortcut for cut and paste don't work either). Is there something special I need to do to get the keyboard shortcuts to work?
Thanks
I have a standard CDialog derived class with some CEdits on it. When I right click one of the edit controls, I get the standard copy/cut/paste menu, and it works fine.
What doesn't work is if I have the edit control hilighted and use the keyboard shortcut ctrl + c. (shortcut for cut and paste don't work either). Is there something special I need to do to get the keyboard shortcuts to work?
Thanks
>>shortcut for cut and paste don't work either
When exactly you cannot use CUT, COPY , PASTE and under which situation same are working?
-MAHESH
When exactly you cannot use CUT, COPY , PASTE and under which situation same are working?
-MAHESH
ASKER
yeah i can't do any of those (CUT, COPY , PASTE). via the KEYBOARD shortcuts.
Actually these are CEdits that I created myself on a CWnd - CEdits created by the wizard on a CDialog derived window are working fine. Is there a specific flag I need to set to get the keyboard shortcuts to work for them? Here's how I'm creating them:
CEdit m_Edit;
m_Edit.Create(WS_CHILD | WS_BORDER, CRect(0,0,23,100), this, SOME_RESOURCE_ID);
Thanks
Actually these are CEdits that I created myself on a CWnd - CEdits created by the wizard on a CDialog derived window are working fine. Is there a specific flag I need to set to get the keyboard shortcuts to work for them? Here's how I'm creating them:
CEdit m_Edit;
m_Edit.Create(WS_CHILD | WS_BORDER, CRect(0,0,23,100), this, SOME_RESOURCE_ID);
Thanks
you have standard dialog or MDI / SDI application with view ?
MDI/SDI :
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B145616
-MAHESH
MDI/SDI :
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B145616
-MAHESH
ASKER
yes it's an MDI app.
>>yes it's an MDI app.
Then follow guidelines here with CEdit::Copy(), CEdit::Cut(), CEdit::Paste()
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B145616
-MAHESH
Then follow guidelines here with CEdit::Copy(), CEdit::Cut(), CEdit::Paste()
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B145616
-MAHESH
ASKER
ok I read the article, but what is the function defintiion that I should add to the header and message map for:
OnUpdateNeedSel(CCmdUI* pCmdUI)
OnUpdateNeedClip(CCmdUI* pCmdUI)
I'm not sure how to add those and the article does not dicuss that.
Thanks
OnUpdateNeedSel(CCmdUI* pCmdUI)
OnUpdateNeedClip(CCmdUI* pCmdUI)
I'm not sure how to add those and the article does not dicuss that.
Thanks
do you have your Edit controls on ForView ?
-MAHESH
-MAHESH
ASKER
well they're created on a CWnd derived class,
Thanks
Thanks
Actually they are handler for ID_EDIT_COPY , ID_EDIT_CUT & ID_EDIT_PASTE
ON_UPDATE_COMMAND_UI (ID_EDIT_CUT, OnUpdateNeedSel)
ON_UPDATE_COMMAND_UI (ID_EDIT_COPY, OnUpdateNeedSel)
-MAHESH
ON_UPDATE_COMMAND_UI (ID_EDIT_CUT, OnUpdateNeedSel)
ON_UPDATE_COMMAND_UI (ID_EDIT_COPY, OnUpdateNeedSel)
-MAHESH
ASKER
what does that mean, I don't understand?
ok before that 1st tell me do you have accelerators defined like :
https://www.experts-exchange.com/questions/20131428/Using-Ctrl-X-Ctrl-C-and-Ctrl-V-with-CHtmlView.html
-MAHESH
https://www.experts-exchange.com/questions/20131428/Using-Ctrl-X-Ctrl-C-and-Ctrl-V-with-CHtmlView.html
-MAHESH
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
When actually thats not working ? when your edit control have focus and text is selected ? As you said not working is Ctrl+C..so CUT ie Ctrl+X is working on your edit box ?
-MAHESH