Is there an error or do the graphs just not work? If you are setting the index in the array to nothing, I would expect this line of code to throw a NullReferenceException since you're calling GetType on a null reference:
For i = 1 to MAXPLOTS - 1
If Not plots(i).GetType is Nothing
plots(i).plotData(dataArray)
End If
Next
If this is the case, I suggest using an
ArrayList instead of an array, and call
ArrayList.RemoveAt to remove the item from the list instead of setting the reference to null. This way you always have valid references, you don't have to worry about the comparison to Nothing, and you can use a For Each loop. If you still want to use an array, you should take the call to GetType out and just compare the value at the specified array index to Nothing.
If this is not the case, could you please post a small test project that reproduces this behavior? Thanks.
- Elton