Results:
The problem is that the previous information will be erased when pasting.
1 UnitUnit1;2 3 Interface4 5 uses6 system.sysutils, System.types, System.uitypes, system.classes, System.variants,7 FMX. Types, FMX. Controls, FMX. Forms, FMX. Graphics, FMX. Dialogs,8System.rtti,//need to introduce9 Fmx.platform, FMX. Scrollbox, FMX. Memo, FMX. Edit, FMX. Controls.presentation,TenFmx.stdctrls;//need to introduce One A type -TForm1 =class(Tform) - Button1:tbutton; the Button2:tbutton; - Edit1:tedit; - Memo1:tmemo; - Button3:tbutton; + Button4:tbutton; - Memo2:tmemo; + Button5:tbutton; A procedureformcreate (sender:tobject); at procedureButton1Click (sender:tobject); - procedureButton2click (sender:tobject); - procedureButton5click (sender:tobject); - procedureButton3click (sender:tobject); - procedureButton4click (sender:tobject); - Private in {Private Declarations} - Public to {Public Declarations} + //define the shear plate global quantization - Fclipboardservice:ifmxclipboardservice; the End; * $ varPanax Notoginseng Form1:tform1; - the Implementation + {$R *.FMX} A {$R *. NMXHDPIPH.FMX ANDROID} the + procedureTform1.button1click (sender:tobject); - begin $ //Method One, using the method of the control to implement the copy $ Edit1.selectall; - Edit1.copytoclipboard; - End; the - procedureTform1.button2click (sender:tobject);Wuyi begin the //Method One, using the method of the control to implement the copy - Memo1.selectall; Wu Memo1.copytoclipboard; - End; About $ procedureTform1.button3click (sender:tobject); - begin - //method Two, using the system's shear plate to achieve the copy - Fclipboardservice.setclipboard (Tvalue (Edit1.text)); A End; + the procedureTform1.button4click (sender:tobject); - begin $ //method Two, using the system's shear plate to achieve the copy the Fclipboardservice.setclipboard (Tvalue (Memo1.text)); the End; the the procedureTform1.button5click (sender:tobject); - begin in //getting data pasted from the system Clipboard theMemo2.text: =FClipboardService.GetClipboard.ToString; the End; About the proceduretform1.formcreate (sender:tobject); the begin the //Initialize the Clipboard + TPlatformServices.Current.SupportsPlatformService (Ifmxclipboardservice, IInterface (Fclipboardservice)); - End; the Bayi End.
Android instance-How to use the system Clipboard