本文整理自网络,侵删。
Delphi移动平台(Android & IOS) Listbox长按查看更多关于 长按 的文章复制查看更多关于 复制 的文章Detail内容
testLongTap参考代码
procedure TForm1.FormCreate(Sender: TObject); //uses FMX.Platform,System.Rtti
begin
//初始化
TPlatformServices.Current.SupportsPlatformService(IFMXClipboardService,
IInterface(FClipboardService));
end;
procedure TForm1.ListBox1Gesture(Sender: TObject;
const [Ref] EventInfo: TGestureEventInfo; var Handled: Boolean);
//ListBox1的Touch--InteractiveGestures--LongTap要选中
begin
case EventInfo.GestureID of
igiLongTap:
begin
if ListBox1.Selected.ItemData.Detail <> '' then
begin
FClipboardService.SetClipboard
(Tvalue(ListBox1.Selected.ItemData.Detail));
Handled := true;
showmessage('已复制' + ListBox1.Selected.ItemData.Text)
end;
end;
end;
end;
相关阅读 >>
Delphi用mapfileandchecksum 函数检测 exe 或 dll 是否被修改
更多相关阅读请进入《Delphi》频道 >>