Hi all,
In the same class I have
Then:
Then:
But here at line 5 I have an error saying that I am not refering to an existing instance whereas I am...
If think it is because at this step the YMDChart is dead even if it is present on my form. I have tried with the declaration "Static" but it is only possible within a method and is incompatible with "with event"...
How should I do?
In the same class I have
VB.NET:
Dim WithEvents YMDChart As Chart
Dim WithEvents YMDChartArea As ChartArea
Then:
VB.NET:
Public Sub PlotYMD() handles ButtonPlot.click
YMDChart = New Chart
YMDChartArea = New ChartArea("YMDChartArea")
YMDChart.ChartAreas.Add(YMDChartArea)
'Series
For Me.Delta = DeltaMin To CDec(DeltaMax) Step DeltaIncrement
YMDChart.Series.Add("Delta " & Round(Delta, 2).ToString & "°")
Next
For Me.Beta = BetaMin To CDec(BetaMax) Step BetaIncrement
YMDChart.Series.Add("Beta " & Round(Beta, 2).ToString & "°")
Next
...
Then:
VB.NET:
Public Sub SetYMDToBlack() handles ButtonPlot.click
if checkbox.checked = true
For Each serie As Series In YMDChart.Series
serie.Color = Color.Black
Next
end if
End Sub
If think it is because at this step the YMDChart is dead even if it is present on my form. I have tried with the declaration "Static" but it is only possible within a method and is incompatible with "with event"...
How should I do?