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 adoquery1 update更新数据

Delphi 如何在在windows平台下实现进程隐藏

Delphi xe10 传感器操作

winapi 字符及字符串函数(12): lstrlen - 串长度

Delphi中如何给一个字符串从左边进行补0

Delphi memo加个prompttext

Delphi string.split 按照任意字符串分割语句

Delphi webbrowser1 缩放网页

如何在Delphi xe中通过ftp下载文件

Delphi xe5 android 开发实现手机打电话和发短信

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



打赏

取消

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

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

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

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

评论

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