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 unigui确认对话框

Delphi 在listview控件中绘底图

processid, process handle, window handle 之间的互相转换

Delphi 获取指定字符串后面的所有的字符串

Delphi Delphi 学习大师qq群讨论的字符串位置替换方法

Delphi 破解access密码

Delphi 实现文件实施监控

Delphi 获取系统所有磁盘盘符

Delphi tgauge类的定义在哪个单元中定义的?

Delphi 动态创建一个ipedit控件

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



打赏

取消

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

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

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

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

评论

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