找传奇、传世资源到传世资源站!

delphi10.1 app开发例程(框架XE10)

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

from clipboardunit u_order;interfaceuses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls, uFrame_Edit, FMX.Layouts, FMX.Objects, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt, Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, FMX.Controls.Presentation;type TFrm_TestOrder = class(TFrame_Edit) FDQuery1: TFDQuery; FDQuery1Issue: TIntegerField; FDQuery1Code: TWideStringField; FDQuery1Name: TWideStringField; FDQuery1_Image: TBlobField; Scr_Item: TFramedScrollBox; procedure btn_OPClick(Sender: TObject); private { Private declarations } public { Public declarations } end;var Frm_TestOrder: TFrm_TestOrder;implementation uses xItemOrder, u_DM,u_DMUse;{$R *.fmx}procedure TFrm_TestOrder.btn_OPClick(Sender: TObject);var I:Integer; TOrder:TFrm_ItemOrder; MemStream: TMemoryStream;begin inherited; FDQuery1.Active:=False; FDQuery1.Active:=True; lyt_Main.BeginUpdate; Try // DM.ApkLog1.SendLog(lyt_Main.ComponentCount.ToString()); for I := lyt_Main.ComponentCount-1 downto 0 do begin if lyt_Main.Components[i].ClassName<>'TFrm_ItemOrder' then Continue; TOrder:=TFrm_ItemOrder(lyt_Main.Components[i]); lyt_Main.RemoveComponent(TOrder); lyt_Main.RemoveObject(TFmxObject(TOrder)); TOrder.Free; end; // DM.ApkLog1.SendLog(lyt_Main.ComponentCount.ToString()); lyt_Main.Repaint; with FDQuery1 do begin DisableControls; try First; while not Eof do begin TOrder:=TFrm_ItemOrder.Create(lyt_Main) ; lyt_Main.AddObject(TOrder); TOrder.Name:='I_' FieldByName('Issue').AsString; TOrder.T_Name.Text:=FieldByName('Name').AsString; MemStream := TMemoryStream.Create; try TBlobField(FieldByName('_Image')).SaveToStream(MemStream); TOrder.crc_Image.Fill.Bitmap.Bitmap.LoadFromStream(MemStream); finally MemStream.Free; end; Next; end; except on E: Exception do // DM.ApkLog1.SendLog(e.Message); end; EnableControls; end; except on E: Exception do //DM.ApkLog1.SendLog(e.Message); End; lyt_Main.EndUpdate;end;end.

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复