Android instance-How to use the system Clipboard

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.