identify.~pas

来自「校园GIS系统——介绍校园个部门」· ~PAS 代码 · 共 61 行

~PAS
61
字号
unit Identify;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Grids, MapObjects2_TLB;

type
  TIdentifyFrm = class(TForm)
    StringGrid1: TStringGrid;
    BtOk: TButton;
    procedure FormActivate(Sender: TObject);
    procedure BtOkClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  IdentifyFrm: TIdentifyFrm;

implementation

uses Main;

{$R *.DFM}

procedure TIdentifyFrm.FormActivate(Sender: TObject);
var
  i:integer;
  ThisRecord:ImoRecordSet;
  ThisTable:ImoTableDesc;
  ThisPoint:imoPoint;
begin
  ThisTable:=coTableDesc.Create;

  ThisTable:=MainFrm.FindRecord.TableDesc;
  if not MainFrm.FindRecord.EOF then
  begin
    StringGrid1.Cells[0,0] :=' 字段 ';
    StringGrid1.Cells[1,0] :=' 值 ';
    StringGrid1.RowCount:=ThisTable.FieldCount-1;
    for i := 0 to ThisTable.FieldCount-1 do
    begin
    StringGrid1.Cells[0,i+1] := MainFrm.FindRecord.fields.Item(ThisTable.FieldName[i]).Name ;
    StringGrid1.Cells[1,i+1] := MainFrm.FindRecord.fields.Item(ThisTable.FieldName[i]).ValueAsString;
    end;
  end;
  MainFrm.FindRecord:=nil;
end;

procedure TIdentifyFrm.BtOkClick(Sender: TObject);
begin
  IdentifyFrm.Close;
 // MainFrm.FindRecord:=nil;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?