P
pihome
Unregistered / Unconfirmed
GUEST, unregistred user!
简单的写了一下
var
i: Integer;
begin
with ADOQuery1 do
begin
SQL.Clear;
SQL.Add('select * from
');
Open;
for i:=0 to FieldCount-1 do
begin
//if 是想要处理的字段 then
Fields .OnGetText:=OnGetText;
dbgrid1.Columns.Width := 32; //想给定的宽度
end;
end;
end;
procedure TForm1.OnGetText(Sender: TField; var Text: String;
DisplayText: Boolean);
begin
Text:=Trim(Sender.AsString);
end;
var
i: Integer;
begin
with ADOQuery1 do
begin
SQL.Clear;
SQL.Add('select * from
Open;
for i:=0 to FieldCount-1 do
begin
//if 是想要处理的字段 then
Fields .OnGetText:=OnGetText;
dbgrid1.Columns.Width := 32; //想给定的宽度
end;
end;
end;
procedure TForm1.OnGetText(Sender: TField; var Text: String;
DisplayText: Boolean);
begin
Text:=Trim(Sender.AsString);
end;