TeePreviewPanel.Panel := FChart;
TeePreviewPanel.PrintMargins := Rect(3, 3, 3, 3); // %
FChart.PrintMargins := TeePreviewPanel.PrintMargins;
TeePreviewPanel.Print;
after Print, FChart.PrintMargins are set to values according to visible margins on TeePreviewPanel. TeePreviewPanel.PrintMargins does'nt change its values, but they are also ignored during Print. Print result depends only on visible form of TeePreviePanel.
I've no idea how to programatically change margins displayed on TeePreviewPanel.
Using Teechart 7.04 VCL, Delphi 7 Personal.
Update:
that's seems to be some bug in VCL:
if some margin on TeePreviewPanel is dragged by mouse prior to changing margins by program, all following margins changes functions as expected
TeePreviewPanel ignores PrintMargins - updated
Hi,
to change the margins of the TeePreviewPanel you must use similar code to the following :
to change the margins of the TeePreviewPanel you must use similar code to the following :
Code: Select all
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
Chart1.PrintProportional := false;
Chart1.PrintMargins:=Rect(3,3,3,3);
TeepreviewPanel1.Panels.Clear;
TeePreviewpanel1.Panels.Add(chart1);
TeePreviewpanel1.Refresh;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com