Delphi Fmx 把内容复制到粘贴板上支持跨平台


本文整理自网络,侵删。

 
unit Unit1;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Edit,
  FMX.Controls.Presentation, FMX.StdCtrls;
type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.fmx}

uses
  FMX.Platform, System.Rtti;

procedure TForm1.Button1Click(Sender: TObject);
var
  C: FMX.Platform.IFMXClipboardService;
  V: System.Rtti.TValue;
begin
  if TPlatformServices.Current.SupportsPlatformService(IFMXClipboardService, IInterface(C)) then begin
    V := TValue.From(Edit1.Text);
    C.SetClipboard(V);
    Showmessage(Edit1.Text+'  已复制');
  end;
end;

end.

相关阅读 >>

Delphi 时间控制窗口标题栏文字或任务栏标题文字滚动

Delphi tadocommand 中文使用说明

Delphi base64单元encddecd的修改

Delphi中adoquery执行错误的捕捉

Delphi 磁盘类型 getdrivetype

strpcopy 将字符串复制到字符数组中

Delphi编写的android程序获取root权限实现(2015.4.15更新,支持android 4.4)

Delphi 检测用户超过多长时间没有操作键盘或鼠标

Delphi里实现彩色图片转为黑白图像的功能

Delphi从memo去重数据

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...