Как предотвратить появление этого сообщения в предварительном просмотре диаграммы: "элемент диаграммы с именем ''уже существует в коллекции серий"?
I have the X-axis and also legends in my chart which are linked whit text-boxes. every text-box is under randomize value and name means don't have special or static name of number it depends on user inserted data. Sometime when there is same name or numbers in two or more then tow text-boxes after debugging VB form the chart show message (A chart element with the name ' ' already exists in the series collection) the ting is I have to include those text-boxes which have the same name, means I cannot ignore them because every text-box data is impotent. So please how can I prevent this message by using code. thanks
Что я уже пробовал:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Try Me.Chart1.Series.Clear() Me.Chart1.Series.Add(Form3.TextBox6.Text) Me.Chart1.Series.Add(Form3.TextBox17.Text) Me.Chart1.Series.Add(Form3.TextBox23.Text) Me.Chart1.Series.Add(Form3.TextBox29.Text) Me.Chart1.Series.Add(Form3.TextBox35.Text) Me.Chart1.Series(Form3.TextBox6.Text).Points.AddXY(Form3.TextBox6.Text, Val(Form3.txtpi1.Text)) Me.Chart1.Series(Form3.TextBox17.Text).Points.AddXY(Form3.TextBox17.Text, Val(Form3.txtpi2.Text)) Me.Chart1.Series(Form3.TextBox23.Text).Points.AddXY(Form3.TextBox23.Text, Val(Form3.txtpi3.Text)) Me.Chart1.Series(Form3.TextBox29.Text).Points.AddXY(Form3.TextBox29.Text, Val(Form3.txtpi4.Text)) Me.Chart1.Series(Form3.TextBox35.Text).Points.AddXY(Form3.TextBox35.Text, Val(Form3.txtpi5.Text)) Catch ex As Exception MessageBox.Show(ex.Message) Finally Beep() End Try End Sub