1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| constructor TFraShowGrid.Create(AOwner: TComponent);
begin
inherited;
Edit1.Clear;
Grid1.Visible := False;
Height := Edit1.Top + Edit1.Height + 1;
Grid1.Parent := TWinControl(AOwner);
Grid1.Width := Edit1.Width;
end;
procedure TFraShowGrid.Button1Click(Sender: TObject);
var
pt: TPoint;
x, y: Integer;
begin
Grid1.Visible := not Grid1.Visible;
if (Grid1.Visible) then
begin
Grid1.Top := Top + Edit1.Top + Edit1.Height;
Grid1.Left := Left + Edit1.Left;
Grid1.BringToFront;
end;
end; |