[Serializable] public class SaveSettings //this what I want to save to the file { public sPictureBox Receipt { get; set; } //This is the picturebox I told you for. public Point ReceiptNoInPaper { get; set; } public ReceiptsSerial.ReceiptSettings.ReceiptsNo ReceiptsNoMethod { get; set; } public int ReceiptsTotalNumber { get; set; } public string SerialNoFormat { get; set; } public int XSpaces { get; set; } public int YSpaces { get; set; } public PageSettings PageSettings { get; set; } public ReceiptsSerial.ReceiptSettings.language Lanaguage { get; set; } public byte[] ConvertToBytes() { BinaryFormatter BF = new BinaryFormatter(); MemoryStream MS = new MemoryStream(); BF.Serialize(MS, this); MS.Close(); return MS.ToArray(); } public SaveSettings ConvertToObject(byte[] Data) { BinaryFormatter BF = new BinaryFormatter(); MemoryStream MS = new MemoryStream(); MS.Write(Data, 0, Data.Length); MS.Seek(0, SeekOrigin.Begin); SaveSettings obj = (SaveSettings)BF.Deserialize(MS); MS.Close(); return obj; } } [Serializable] public class sPictureBox : PictureBox {} //I tried this in order to get rather from the error but hopless :(
PictureBox
[Serializable] public class MyPictureBox:PictureBox { // create your properties which you need to Serialize // eg: public int Width {get;set;} }
[Serializable]public class sPictureBox : PictureBox {} //I tried this in order to get rather from the error but hopless :(
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)