DBGridEh,如何通过字段名查找列?
var
i: integer;
begin
for i := 0 to DBgridEh1.columns.count - 1 do
begin
if DBgridEh1.columns[i].FieldName = '你想要的' then
DBgridEh1.columns[i].Visible := True;
end;
DBgridEh1.FieldColumns['字段名A'].Visible:=true;
DBgridEh1.FieldColumns['字段名B'].Visible:=false;
DBgridEh1.FieldColumns['name'].Visible:=false;
好的代码像粥一样,都是用时间熬出来的