ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  How to check if a chart is load ?
Posted by Daniel on Jan-31-2013 14:59
Hello Peter,

Simply I am stuck in a condition which shouldn't be complicated. My program has some lines that are very similar with your VBChartDemo. So, we can use that demo as reference. As you know, you prefer in your demo to have as default a chart load from Form event. This chart is a "Simple Pie Chart" and you use for this the following line:
tvTreeView.SelectedItem = tvTreeView.Nodes("Simple Pie Chart").
After that you call a refresh demo subroutine which does create the chart and, at the end, you resize the chart calling the "layoutCharts" .
My program has not as default any chart load from Form event but I would like to call the "Resize" subroutine only in the case when a chart is load or visible...
So, I am looking for something like this:

"If ChartViewer(..any..).Visible = True    ' or ChartViewer(..any..) is load
    Call myResize
End If"

My question is: how to detect, at the code level, if a chart is displayed or not ?
I suppose you have already guessed that I work in VB6. Thank you in advance.

Regards,
Daniel

  Re: How to check if a chart is load ?
Posted by Peter Kwan on Feb-01-2013 01:30
Hi Daniel,

I think you can use a loop to check if at least a chart viewer is visible, like:

For i = 0 To ChartViewer.Count - 1
    If chartViewer(i).Visible Then
        Call myResize
        Exit For
    End If
Next

Hope this can help.

Regards
Peter Kwan