Dear friends, is there a way to disable copy operation? I need to show a multipage document so I can't disable the control and READONLY clause still allows to select the text.
Thank you.
EMG
Dear friends, is there a way to disable copy operation? I need to show a multipage document so I can't disable the control and READONLY clause still allows to select the text.
Thank you.
EMG
Hi Enrico.
I changed my class to check lReadOnly state, and I enable and disable some operations like copy if it is true.
Regards,
Toninho.
Yes, but I don't know how to prevent the user from select and copy the text.
EMG
Enrico,
Maybe this article can help you, but you need change richedit.c that is not provide with fwh:
http://www.codeguru.com/cpp/controls/ri ... php/c2401/
Regards,
Toninho.
I think this will avoid Copy, although you can still select a text:
1) Yo have to EXTEND CLASS tRichEdit WITH DATA lCanCopy
2) you have to edit and override Method CanCopy, Method Copy and Method KeyDown (to handle CTRL-C) in class tRichEdit.
METHOD CanCopy() INLINE ((ValType(::lCanCopy)<>"L" .or. ::lCanCopy) .and. ::IsSelection()) //This disables Copy option in rigth click menu
METHOD Copy() CLASS TRichEdit
#ifdef __XPP__
#undef New
#endif
DEFAULT ::lCanCopy:=.T.
if ::lCanCopy
::SendMsg( WM_COPY )
endif
return nil
METHOD KeyDown( nKey, nFlags ) CLASS TRichEdit
if (nKey == Asc( "C" ) .and. GetKeyState( VK_CONTROL ) )
::Copy()
return 0
endif
:
:
Regards
Thank you. I already solved it using bKeyDown codeblock.
EMG
but you can still copy using context right-click menu...
No, I already disable it too using bRClicked codeblock. ![]()
EMG