Создаю динамически TStringgrid
Код:
with TStringGrid.Create(Self) do
begin
RowCount:=1;
ColCount:=2;
Parent := pnl1;
Name := 'sg'+inttostr(i);
Options := Options + [goEditing];
Options := Options -[goDrawFocusSelected];
Left:=0;
DefaultRowHeight:=24;
Top:=DefaultRowHeight*i;
FixedCols:=0;
FixedRows:=0;
ColWidths[0]:=20;
ColWidths[1]:=50;
Width :=ColWidths[0]+ColWidths[1]+5;
Height :=DefaultRowHeight+2;
GridClean(????);
end;
Процедура в которую передаю созданный TStringgrid
Код:
procedure TForm1.GridClean(Sender: TObject);
var
hGridRect: TGridRect;
begin
hGridRect.Top := -1;
hGridRect.Left := -1;
hGridRect.Right := -1;
hGridRect.Bottom := -1;
(Sender as TStringgrid).Selection := hGridRect;
end;