Home > Back-end >  FMX memo set readonly, is there any way to prohibit selected copy?
FMX memo set readonly, is there any way to prohibit selected copy?

Time:09-20

FMX memo set readonly:=true, is there any way to ban long according to the selected copy?

CodePudding user response:

Memo Enable attribute set to False, the outside can be written as,

CodePudding user response:

Memo CopyToClipboard; Is not a virtual method, nor OnCopyToClipboard; Such events, there are only two way,
First, modify the Memo of the source code
Second, the simple and crude when you don't need to copy it with
TPlatformServices. Current. SupportsPlatformService backup for shear plate down
TPlatformServices. Current. RemovePlatformService (IFMXClipboardService);
Let the system does not support the clipboard,
The disadvantage is that the other controls also can't reproduce,
Need to copy TPlatformServices. Current. AddPlatformService (); Add the backup just now come back

CodePudding user response:

1, the TMemo set ReadOnly:=True; This is not through the keyboard input character, not block replication,
2, the TMemo right-click context menu of the default system, including copy, copy, and so on project,
3, shielding the TMemo right-click context menu, can add a TPopupMenu through the window, not TPopupMenu set, which make it without TMenuItem menu item, let the TMemo PopupMenu is specified for the PopupMenu1, so, when you run the TMemo right, shielding,

CodePudding user response:

Try CanFocus set to False, a total ban on editor can use the Label,

CodePudding user response:

If copy to screen buttons, can
Procedure Tfrmx. MemoKeyPress (Sender: TObject; Var Key: Char);
The begin
Key:=Char (0);
end;

CodePudding user response:

reference 5 floor xxfly reply:
copy if need screen buttons, it can be
Procedure Tfrmx. MemoKeyPress (Sender: TObject; Var Key: Char);
The begin
Key:=Char (0);
end;


This method can control the shortcut key,

CodePudding user response:

refer to 6th floor lyhoo163 response:
Quote: refer to the fifth floor xxfly reply:

If copy to screen buttons, can
Procedure Tfrmx. MemoKeyPress (Sender: TObject; Var Key: Char);
The begin
Key:=Char (0);
end;

This method can control the shortcuts,

Fmx Memo no KeyPress events,
  • Related