I placed on the form FMain: Chart1 (TChart) and Panel1 (TPanel) with Label1 and Label2 (TLabel). I used procedure TFMain.FormShow with two statements:
Label1.Caption:=IntToStr(Chart1.ChartHeight);
Label2.Caption:=IntToStr(Chart1.ChartWidth);
and procedure TFMain.Panel1Click with the same two statements.
However, at the start of my program, I obtain “0” and “0”, but when I click on Panel1, I obtain the actual height and the actual width of the Chart1. What is it? How I can obtain correct sizes of Chart1 right after the start of this program?
Chart Height and Width
Chart Height and Width
Last edited by avp on Fri Apr 10, 2009 12:49 am, edited 1 time in total.
Hi avp,
I think that you'll need to force the chart to be drawn a first time if you want retrieve info from it that won't be updated until it will be drawn.
I think that you'll need to force the chart to be drawn a first time if you want retrieve info from it that won't be updated until it will be drawn.
Code: Select all
Chart1.Draw;
Label1.Caption:=IntToStr(Chart1.ChartHeight);
Label2.Caption:=IntToStr(Chart1.ChartWidth);
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Chart Height and Width
Tank you very much!