میتونی برای هر سیمبل یه control / componnent بنویسی که یه اسم داشته باشه ( برای ذخیره کردن ) و یه شکل که بشه توی فرم اونو Paint کرد ... برای ذخیره کردنشم میتونی از Serialize استفاده کنی ...
[Serializable()]
public class Kasr : Control
{
public string TopExp { get; set; }
public string BottomExp { get; set; }
public Kasr()
{
this.Width = 100;
this.Height = 60;
}
public Kasr(string top, string bottom)
{
this.TopExp = top;
this.BottomExp = bottom;
}
protected override void OnPaint(PaintEventArgs e)
{
SizeF topSize = e.Graphics.MeasureString(this.TopExp, this.Font);
SizeF bSize = e.Graphics.MeasureString(this.BottomExp, this.Font);
SizeF lineSize = new SizeF(Math.Max(topSize.Width, bSize.Width), 5);
e.Graphics.DrawString(this.TopExp, this.Font, Brushes.Black, 0, 0);
e.Graphics.DrawLine(Pens.Black, 0, (topSize.Height + lineSize.Height / 2), lineSize.Width, (topSize.Height + lineSize.Height / 2));
e.Graphics.DrawString(this.BottomExp, this.Font, Brushes.Black, 0, topSize.Height + lineSize.Height);
}
public void Save()
{
BinaryFormatter writer = new BinaryFormatter();
FileStream fileSt = new FileStream("d:\\formul.txt", FileMode.OpenOrCreate);
writer.Serialize(fileSt, this);
fileSt.Close();
}
public static Kasr Load()
{
BinaryFormatter reader = new BinaryFormatter();
FileStream fileSt = new FileStream("d:\\formul.txt", FileMode.Open,FileAccess.Read);
object obj = reader.Deserialize(fileSt);
fileSt.Close();
return (Kasr)obj;
}
}
برای رسم نمودارهم MSChart هست ...