Page 1 of 1

Is it possible to dynamically resize the chart?

Posted: Fri Mar 24, 2006 2:15 am
by 9529132
Hi,

When I include the chart in a form view, I hope it can be dynamically resized when the window size changes. Is it possible to do that? Thank you very much!

David

Posted: Fri Mar 31, 2006 7:51 am
by Pep
Hi David,

you can use similar code to the below :

Code: Select all

Private Sub Form_Load()
With TChart1
    .AddSeries scLine
    .Series(0).FillSampleValues 20
End With
ResizeChart
End Sub

Private Sub Form_Resize()
ResizeChart
End Sub

Private Sub ResizeChart()
With TChart1
    .Top = 0
    .Left = 0
    .Height = Me.ScaleHeight
    .Width = Me.ScaleWidth
    .Repaint
End With
End Sub

Posted: Fri Apr 21, 2006 7:26 am
by 9529132
Hi, Pep,

Got it. Thank you very much!

David