1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| private void chartIta_Click(object sender, EventArgs e)
{
Chart tempChart = new Chart();
// Save chart into the memory stream
MemoryStream ms = new MemoryStream();
chartIta.Serializer.Save(ms);
// Load data from memory stream into the second chart
ms.Seek(0, SeekOrigin.Begin);
tempChart.Serializer.Load(ms);
ms.Close();
tempChart.Size = new Size(770, 620);
Form frmDisplay = new Form();
frmDisplay.ShowInTaskbar = false;
frmDisplay.StartPosition = FormStartPosition.CenterParent;
frmDisplay.FormBorderStyle = FormBorderStyle.None;
frmDisplay.Size = new Size(770, 620);
tempChart.Dock = DockStyle.Fill;
//adds the temporary chart to the new form
frmDisplay.Controls.Add(tempChart);
frmDisplay.ShowDialog();
frmDisplay.Click += new EventHandler(frmDisplay_Click);
}
void frmDisplay_Click(object sender, EventArgs e)
{
this.Close();
} |
Partager