Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

keyboard shortcuts for CEdit

Posted on 2007-08-01
13
Medium Priority
?
582 Views
Last Modified: 2013-11-20
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
0
Comment
Question by:DJ_AM_Juicebox
  • 8
  • 5
13 Comments
 
LVL 22

Expert Comment

by:mahesh1402
ID: 19615631
>>What doesn't work is if I have the edit control hilighted

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
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 19615684
>>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
0
 

Author Comment

by:DJ_AM_Juicebox
ID: 19616014
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
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 22

Expert Comment

by:mahesh1402
ID: 19616264
you have standard dialog or MDI / SDI application with view ?

MDI/SDI :
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B145616

-MAHESH
0
 

Author Comment

by:DJ_AM_Juicebox
ID: 19616558
yes it's an MDI app.
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 19616873
>>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

0
 

Author Comment

by:DJ_AM_Juicebox
ID: 19617016
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
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 19617059
do you have your Edit controls on ForView ?

-MAHESH
0
 

Author Comment

by:DJ_AM_Juicebox
ID: 19617127
well they're created on a CWnd derived class,

Thanks
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 19617417
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

0
 

Author Comment

by:DJ_AM_Juicebox
ID: 19618113
what does that mean, I don't understand?
0
 
LVL 22

Expert Comment

by:mahesh1402
ID: 19619057
ok before that 1st tell me do you have accelerators defined like :

http://www.experts-exchange.com/Programming/System/Windows__Programming/MFC/Q_20131428.html

-MAHESH
0
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 2000 total points
ID: 19625482
i mean to say have you checking you dont have any accelerators in your folder like ID_EDIT_COPY as discussed in above thread.

-MAHESH
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question