Visual C++, eliminate copy, cut, paste?

fs5

Lifer
Jun 10, 2000
11,774
1
0
I want to use a CEdit field (MFC) but I want to override the Copy, Cut, and Paste features (basically disable them). How would one go about doing this?
 

Gaunt

Senior member
Aug 29, 2001
450
0
0
I expected a simple solution to this problem, but the only thing I could find was a suggestion to create your own subclass of CEdit and use that on your form. Obviously this is a little trickier than dropping CEdit on your form, as you will have to create the control in code.

This forum entry asks the same question you did and presents a partial solution for implementing the subclass necessary. Basically the subclassed form this person created filters out the common attempts to paste by disabling right mouse button clicks on the control, as well as attempts to use CTRL+V.
 

fs5

Lifer
Jun 10, 2000
11,774
1
0
Originally posted by: Gaunt
I expected a simple solution to this problem, but the only thing I could find was a suggestion to create your own subclass of CEdit and use that on your form. Obviously this is a little trickier than dropping CEdit on your form, as you will have to create the control in code.

This forum entry asks the same question you did and presents a partial solution for implementing the subclass necessary. Basically the subclassed form this person created filters out the common attempts to paste by disabling right mouse button clicks on the control, as well as attempts to use CTRL+V.

I thought the solution would be very simple too! :( I created my own subclass but was trying to overload the Paste() function which of course didn't work. Your linked worked, thanks a billion.