public void SetFrequencyDataGrid(DataGridView data, FrequencyTypeTask freqTypeTask) { switch (freqTypeTask) { case FrequencyTypeTask.Letter: data.Parent = dataGridViewFreqLetter.Parent; data.Name = dataGridViewFreqLetter.Name; data.Parent.Controls.Remove(dataGridViewFreqLetter); dataGridViewFreqLetter = data; dataGridViewFreqLetter.Parent.Controls.Add(dataGridViewFreqLetter); //dataGridViewFreqLetter = data; //dataGridViewFreqLetter.Parent.Controls.Add(dataGridViewFreqLetter); break; case FrequencyTypeTask.PairLetter: data.Parent = dataGridViewFreqPairLetter.Parent; data.Name = dataGridViewFreqPairLetter.Name; data.Parent.Controls.Remove(dataGridViewFreqPairLetter); dataGridViewFreqPairLetter = data; dataGridViewFreqPairLetter.Parent.Controls.Add(dataGridViewFreqPairLetter); break; } }
public void SetFrequencyChart(Chart chart, FrequencyTypeTask freqTypeTask) { switch (freqTypeTask) { case FrequencyTypeTask.Letter: chartFrqeLetters.ChartAreas.Clear();; chartFrqeLetters.Series.Clear(); chartFrqeLetters.Legends.Clear(); chartFrqeLetters.ChartAreas.Add(chart.ChartAreas[0]); chartFrqeLetters.Series.Add(chart.Series[0]); // chartFrqeLetters.Parent = groupBox2; break; case FrequencyTypeTask.PairLetter: chartFrqePairLetters.ChartAreas.Clear();; chartFrqePairLetters.Series.Clear(); chartFrqePairLetters.Legends.Clear(); chartFrqePairLetters.ChartAreas.Add(chart.ChartAreas[0]); chartFrqePairLetters.Series.Add(chart.Series[0]); break; } }