用createmessagedialog 来定制对话框,可以参照 delphi 的DEMOs/Ado/Adotest
procedure ShowProperties(Props: Properties);
var
I: Integer;
F: TForm;
Button: TButton;
begin
F := CreateMessageDialog('', mtInformation, [mbCancel]);
F.Height := Screen.Height div 2;
F.Width := Screen.Width div 2;
Button := F.Components[2] as TButton;
Button.Top := F.ClientHeight - Button.Height - 5;
Button.Left := (F.ClientWidth - Button.Width) div 2;
F.Caption := 'Properties';
with TMemo.Create(F)do
begin
SetBounds(5, 5, F.ClientWidth-10, F.ClientHeight - 40);
Parent := F;
for I := 0 to Props.Count - 1do
with Propsdo
Lines.Add(Format('%-30s: %s', [Name, VarToStr(Value)]));
end;
F.ShowModal;
end;