开发者

Delphi: Show the same Graph on 2 different forms

开发者 https://www.devze.com 2023-02-12 19:44 出处:网络
I would like to show the same graph (TChart) on 2 different forms. on the first there is a small version, but i would like the user to be able to click a button to 开发者_StackOverflow中文版show a big

I would like to show the same graph (TChart) on 2 different forms. on the first there is a small version, but i would like the user to be able to click a button to 开发者_StackOverflow中文版show a bigger version of the graph.


You could have two different controls in which you supply the same set of data. or you can try setting the parent of the control on the new form.

TSmallForm = class
...
procedure TSmallForm.Button1Click(sender : TObject)
var
  F : TForm;
begin
  F := TForm.Create;
  try
    ChartComponent.Parent := F;
    ChartComponent.Align := alClient;
    F.ShowModal;
  finally
    F.Free;
  end;
end;
0

精彩评论

暂无评论...
验证码 换一张
取 消