jmkotman
asked on
file read in as a string and divide into Date form C#
I am writing a GUI program in C#. Â The program reads in a file using the "split" format. Â I read in a string date = split[0]; Â When it is read in the string is set to 05 06 06. Â I need to now take that string which is done in a method in the "Main" file and transfer it to another class that accept a string and divide it to month, day, and year. And also override the ToString() method to print it as mm/dd/yy. Â I don't know how to take that string date from the method and transfer it to another class and then also how to convert it into the date formate as listed above
Below is the Form1.cs class which reads in the file
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Runtime.Serializati on.Formatt ers.Binary ;
using System.Runtime.Serializati on;
namespace WindowsApplication2
{
      [Serializable]
      public class Form1 : System.Windows.Forms.Form
      {
           private System.Windows.Forms.Label label1;
           private System.Windows.Forms.Label label2;
           private System.Windows.Forms.TextB ox saledate;
           private System.Windows.Forms.Butto n button1;
           private System.Windows.Forms.Group Box groupBox1;
           private System.Windows.Forms.Label label3;
           private System.Windows.Forms.Label label4;
           private System.Windows.Forms.Label label5;
           private System.Windows.Forms.Label label6;
           private System.Windows.Forms.Label label7;
           private System.Windows.Forms.Label label8;
           private System.Windows.Forms.Label label9;
           private System.Windows.Forms.TextB ox textBox2;
           private System.Windows.Forms.TextB ox maker;
           private System.Windows.Forms.TextB ox model;
           private System.Windows.Forms.TextB ox year;
           private System.Windows.Forms.TextB ox textBox6;
           private System.Windows.Forms.TextB ox mileage;
           private System.Windows.Forms.TextB ox price;
           private System.Windows.Forms.Group Box customerinformation;
           private System.Windows.Forms.Label label10;
           private System.Windows.Forms.Label label11;
           private System.Windows.Forms.Label label12;
           private System.Windows.Forms.TextB ox id;
           private System.Windows.Forms.TextB ox name;
           private System.Windows.Forms.TextB ox address;
           private System.Windows.Forms.Label label13;
           private System.Windows.Forms.Label label14;
           private System.Windows.Forms.Label label15;
           private System.Windows.Forms.Label label16;
           private System.Windows.Forms.TextB ox textBox4;
           private System.Windows.Forms.TextB ox idnumber;
           private System.Windows.Forms.TextB ox expdate;
           private System.Windows.Forms.Label label17;
           private System.Windows.Forms.Label label18;
           private System.Windows.Forms.Label label19;
           private System.Windows.Forms.Label label20;
           private System.Windows.Forms.Label label21;
           private System.Windows.Forms.Label label23;
           private System.Windows.Forms.Label label24;
           private System.Windows.Forms.Label label25;
           private System.Windows.Forms.Label label27;
           private System.Windows.Forms.Label label28;
           private System.Windows.Forms.Label label29;
           private System.Windows.Forms.Label label30;
           private System.Windows.Forms.TextB ox textBox7;
           private System.Windows.Forms.TextB ox textBox8;
           private System.Windows.Forms.TextB ox textBox9;
           private System.Windows.Forms.TextB ox textBox10;
           private System.Windows.Forms.Group Box borrowedamount;
           private System.Windows.Forms.TextB ox downpayment;
           private System.Windows.Forms.TextB ox taxamount;
           private System.Windows.Forms.TextB ox numberofmonths;
           private System.Windows.Forms.TextB ox monthlypayment;
           private System.Windows.Forms.TextB ox taxrate;
           private System.Windows.Forms.TextB ox interestrate;
           private System.Windows.Forms.TextB ox recordnumber;
           /// <summary>
           /// Required designer variable.
           /// </summary>
           private System.ComponentModel.Cont ainer components = null;
           public Form1()
           {
                 //
                 // Required for Windows Form Designer support
                 //
                 InitializeComponent();
                 //
                 // TODO: Add any constructor code after InitializeComponent call
                 //
           }
           /// <summary>
           /// Clean up any resources being used.
           /// </summary>
           protected override void Dispose( bool disposing )
           {
                 if( disposing )
                 {
                      if (components != null)
                      {
                            components.Dispose();
                      }
                 }
                 base.Dispose( disposing );
           }
           #region Windows Form Designer generated code
           /// <summary>
           /// Required method for Designer support - do not modify
           /// the contents of this method with the code editor.
           /// </summary>
           private void InitializeComponent()
           {
                 this.label1 = new System.Windows.Forms.Label ();
                 this.label2 = new System.Windows.Forms.Label ();
                 this.recordnumber = new System.Windows.Forms.TextB ox();
                 this.saledate = new System.Windows.Forms.TextB ox();
                 this.button1 = new System.Windows.Forms.Butto n();
                 this.groupBox1 = new System.Windows.Forms.Group Box();
                 this.price = new System.Windows.Forms.TextB ox();
                 this.mileage = new System.Windows.Forms.TextB ox();
                 this.textBox6 = new System.Windows.Forms.TextB ox();
                 this.year = new System.Windows.Forms.TextB ox();
                 this.model = new System.Windows.Forms.TextB ox();
                 this.maker = new System.Windows.Forms.TextB ox();
                 this.textBox2 = new System.Windows.Forms.TextB ox();
                 this.label9 = new System.Windows.Forms.Label ();
                 this.label8 = new System.Windows.Forms.Label ();
                 this.label7 = new System.Windows.Forms.Label ();
                 this.label6 = new System.Windows.Forms.Label ();
                 this.label5 = new System.Windows.Forms.Label ();
                 this.label4 = new System.Windows.Forms.Label ();
                 this.label3 = new System.Windows.Forms.Label ();
                 this.customerinformation = new System.Windows.Forms.Group Box();
                 this.expdate = new System.Windows.Forms.TextB ox();
                 this.textBox4 = new System.Windows.Forms.TextB ox();
                 this.idnumber = new System.Windows.Forms.TextB ox();
                 this.label16 = new System.Windows.Forms.Label ();
                 this.label15 = new System.Windows.Forms.Label ();
                 this.label14 = new System.Windows.Forms.Label ();
                 this.label13 = new System.Windows.Forms.Label ();
                 this.address = new System.Windows.Forms.TextB ox();
                 this.name = new System.Windows.Forms.TextB ox();
                 this.id = new System.Windows.Forms.TextB ox();
                 this.label12 = new System.Windows.Forms.Label ();
                 this.label11 = new System.Windows.Forms.Label ();
                 this.label10 = new System.Windows.Forms.Label ();
                 this.borrowedamount = new System.Windows.Forms.Group Box();
                 this.interestrate = new System.Windows.Forms.TextB ox();
                 this.taxrate = new System.Windows.Forms.TextB ox();
                 this.monthlypayment = new System.Windows.Forms.TextB ox();
                 this.numberofmonths = new System.Windows.Forms.TextB ox();
                 this.textBox10 = new System.Windows.Forms.TextB ox();
                 this.textBox9 = new System.Windows.Forms.TextB ox();
                 this.textBox8 = new System.Windows.Forms.TextB ox();
                 this.textBox7 = new System.Windows.Forms.TextB ox();
                 this.taxamount = new System.Windows.Forms.TextB ox();
                 this.downpayment = new System.Windows.Forms.TextB ox();
                 this.label30 = new System.Windows.Forms.Label ();
                 this.label29 = new System.Windows.Forms.Label ();
                 this.label28 = new System.Windows.Forms.Label ();
                 this.label25 = new System.Windows.Forms.Label ();
                 this.label24 = new System.Windows.Forms.Label ();
                 this.label20 = new System.Windows.Forms.Label ();
                 this.label18 = new System.Windows.Forms.Label ();
                 this.label17 = new System.Windows.Forms.Label ();
                 this.label19 = new System.Windows.Forms.Label ();
                 this.label21 = new System.Windows.Forms.Label ();
                 this.label23 = new System.Windows.Forms.Label ();
                 this.label27 = new System.Windows.Forms.Label ();
                 this.groupBox1.SuspendLayo ut();
                 this.customerinformation.S uspendLayo ut();
                 this.borrowedamount.Suspen dLayout();
                 this.SuspendLayout();
                 //
                 // label1
                 //
                 this.label1.Location = new System.Drawing.Point(16, 24);
                 this.label1.Name = "label1";
                 this.label1.Size = new System.Drawing.Size(88, 16);
                 this.label1.TabIndex = 0;
                 this.label1.Text = "Record Number:";
                 //
                 // label2
                 //
                 this.label2.Location = new System.Drawing.Point(16, 64);
                 this.label2.Name = "label2";
                 this.label2.Size = new System.Drawing.Size(64, 16);
                 this.label2.TabIndex = 1;
                 this.label2.Text = "Sale Date:";
                 //
                 // recordnumber
                 //
                 this.recordnumber.Location = new System.Drawing.Point(120, 24);
                 this.recordnumber.Name = "recordnumber";
                 this.recordnumber.Size = new System.Drawing.Size(104, 20);
                 this.recordnumber.TabIndex = 2;
                 this.recordnumber.Text = "";
                 this.recordnumber.TextChan ged += new System.EventHandler(this.t extBox1_Te xtChanged) ;
                 //
                 // saledate
                 //
                 this.saledate.Location = new System.Drawing.Point(120, 64);
                 this.saledate.Name = "saledate";
                 this.saledate.Size = new System.Drawing.Size(104, 20);
                 this.saledate.TabIndex = 3;
                 this.saledate.Text = "";
                 //
                 // button1
                 //
                 this.button1.Location = new System.Drawing.Point(72, 112);
                 this.button1.Name = "button1";
                 this.button1.Size = new System.Drawing.Size(128, 40);
                 this.button1.TabIndex = 4;
                 this.button1.Text = "Next";
                 this.button1.Click += new System.EventHandler(this.b utton1_Cli ck);
                 //
                 // groupBox1
                 //
                 this.groupBox1.Controls.Ad d(this.pri ce);
                 this.groupBox1.Controls.Ad d(this.mil eage);
                 this.groupBox1.Controls.Ad d(this.tex tBox6);
                 this.groupBox1.Controls.Ad d(this.yea r);
                 this.groupBox1.Controls.Ad d(this.mod el);
                 this.groupBox1.Controls.Ad d(this.mak er);
                 this.groupBox1.Controls.Ad d(this.tex tBox2);
                 this.groupBox1.Controls.Ad d(this.lab el9);
                 this.groupBox1.Controls.Ad d(this.lab el8);
                 this.groupBox1.Controls.Ad d(this.lab el7);
                 this.groupBox1.Controls.Ad d(this.lab el6);
                 this.groupBox1.Controls.Ad d(this.lab el5);
                 this.groupBox1.Controls.Ad d(this.lab el4);
                 this.groupBox1.Controls.Ad d(this.lab el3);
                 this.groupBox1.Location = new System.Drawing.Point(16, 168);
                 this.groupBox1.Name = "groupBox1";
                 this.groupBox1.Size = new System.Drawing.Size(256, 344);
                 this.groupBox1.TabIndex = 5;
                 this.groupBox1.TabStop = false;
                 this.groupBox1.Text = "Car Information";
                 //
                 // price
                 //
                 this.price.Location = new System.Drawing.Point(112, 312);
                 this.price.Name = "price";
                 this.price.Size = new System.Drawing.Size(128, 20);
                 this.price.TabIndex = 14;
                 this.price.Text = "";
                 //
                 // mileage
                 //
                 this.mileage.Location = new System.Drawing.Point(112, 264);
                 this.mileage.Name = "mileage";
                 this.mileage.Size = new System.Drawing.Size(128, 20);
                 this.mileage.TabIndex = 13;
                 this.mileage.Text = "";
                 //
                 // textBox6
                 //
                 this.textBox6.Location = new System.Drawing.Point(112, 216);
                 this.textBox6.Name = "textBox6";
                 this.textBox6.Size = new System.Drawing.Size(128, 20);
                 this.textBox6.TabIndex = 12;
                 this.textBox6.Text = "";
                 //
                 // year
                 //
                 this.year.Location = new System.Drawing.Point(112, 168);
                 this.year.Name = "year";
                 this.year.Size = new System.Drawing.Size(128, 20);
                 this.year.TabIndex = 11;
                 this.year.Text = "";
                 //
                 // model
                 //
                 this.model.Location = new System.Drawing.Point(112, 120);
                 this.model.Name = "model";
                 this.model.Size = new System.Drawing.Size(128, 20);
                 this.model.TabIndex = 10;
                 this.model.Text = "";
                 //
                 // maker
                 //
                 this.maker.Location = new System.Drawing.Point(112, 72);
                 this.maker.Name = "maker";
                 this.maker.Size = new System.Drawing.Size(128, 20);
                 this.maker.TabIndex = 9;
                 this.maker.Text = "";
                 //
                 // textBox2
                 //
                 this.textBox2.Location = new System.Drawing.Point(112, 32);
                 this.textBox2.Name = "textBox2";
                 this.textBox2.Size = new System.Drawing.Size(128, 20);
                 this.textBox2.TabIndex = 8;
                 this.textBox2.Text = "";
                 //
                 // label9
                 //
                 this.label9.Location = new System.Drawing.Point(8, 312);
                 this.label9.Name = "label9";
                 this.label9.Size = new System.Drawing.Size(40, 16);
                 this.label9.TabIndex = 7;
                 this.label9.Text = "Price:";
                 //
                 // label8
                 //
                 this.label8.Location = new System.Drawing.Point(8, 272);
                 this.label8.Name = "label8";
                 this.label8.Size = new System.Drawing.Size(48, 16);
                 this.label8.TabIndex = 6;
                 this.label8.Text = "Mileage:";
                 //
                 // label7
                 //
                 this.label7.Location = new System.Drawing.Point(8, 224);
                 this.label7.Name = "label7";
                 this.label7.Size = new System.Drawing.Size(40, 16);
                 this.label7.TabIndex = 5;
                 this.label7.Text = "Color:";
                 //
                 // label6
                 //
                 this.label6.Location = new System.Drawing.Point(8, 176);
                 this.label6.Name = "label6";
                 this.label6.Size = new System.Drawing.Size(40, 16);
                 this.label6.TabIndex = 4;
                 this.label6.Text = "Year:";
                 //
                 // label5
                 //
                 this.label5.Location = new System.Drawing.Point(8, 128);
                 this.label5.Name = "label5";
                 this.label5.Size = new System.Drawing.Size(40, 16);
                 this.label5.TabIndex = 3;
                 this.label5.Text = "Model:";
                 //
                 // label4
                 //
                 this.label4.Location = new System.Drawing.Point(8, 80);
                 this.label4.Name = "label4";
                 this.label4.Size = new System.Drawing.Size(40, 16);
                 this.label4.TabIndex = 2;
                 this.label4.Text = "Maker:";
                 //
                 // label3
                 //
                 this.label3.Location = new System.Drawing.Point(8, 32);
                 this.label3.Name = "label3";
                 this.label3.Size = new System.Drawing.Size(88, 16);
                 this.label3.TabIndex = 1;
                 this.label3.Text = "Stock Number:";
                 //
                 // customerinformation
                 //
                 this.customerinformation.C ontrols.Ad d(this.exp date);
                 this.customerinformation.C ontrols.Ad d(this.tex tBox4);
                 this.customerinformation.C ontrols.Ad d(this.idn umber);
                 this.customerinformation.C ontrols.Ad d(this.lab el16);
                 this.customerinformation.C ontrols.Ad d(this.lab el15);
                 this.customerinformation.C ontrols.Ad d(this.lab el14);
                 this.customerinformation.C ontrols.Ad d(this.lab el13);
                 this.customerinformation.C ontrols.Ad d(this.add ress);
                 this.customerinformation.C ontrols.Ad d(this.nam e);
                 this.customerinformation.C ontrols.Ad d(this.id) ;
                 this.customerinformation.C ontrols.Ad d(this.lab el12);
                 this.customerinformation.C ontrols.Ad d(this.lab el11);
                 this.customerinformation.C ontrols.Ad d(this.lab el10);
                 this.customerinformation.L ocation = new System.Drawing.Point(288, 8);
                 this.customerinformation.N ame = "customerinformation";
                 this.customerinformation.S ize = new System.Drawing.Size(528, 216);
                 this.customerinformation.T abIndex = 6;
                 this.customerinformation.T abStop = false;
                 this.customerinformation.T ext = "Customer Information";
                 //
                 // expdate
                 //
                 this.expdate.Location = new System.Drawing.Point(344, 160);
                 this.expdate.Name = "expdate";
                 this.expdate.Size = new System.Drawing.Size(152, 20);
                 this.expdate.TabIndex = 12;
                 this.expdate.Text = "";
                 //
                 // textBox4
                 //
                 this.textBox4.Location = new System.Drawing.Point(344, 104);
                 this.textBox4.Name = "textBox4";
                 this.textBox4.Size = new System.Drawing.Size(152, 20);
                 this.textBox4.TabIndex = 11;
                 this.textBox4.Text = "";
                 //
                 // idnumber
                 //
                 this.idnumber.Location = new System.Drawing.Point(344, 56);
                 this.idnumber.Name = "idnumber";
                 this.idnumber.Size = new System.Drawing.Size(152, 20);
                 this.idnumber.TabIndex = 10;
                 this.idnumber.Text = "";
                 //
                 // label16
                 //
                 this.label16.Location = new System.Drawing.Point(256, 160);
                 this.label16.Name = "label16";
                 this.label16.Size = new System.Drawing.Size(64, 24);
                 this.label16.TabIndex = 9;
                 this.label16.Text = "Exp. Date:";
                 //
                 // label15
                 //
                 this.label15.Location = new System.Drawing.Point(256, 112);
                 this.label15.Name = "label15";
                 this.label15.Size = new System.Drawing.Size(40, 24);
                 this.label15.TabIndex = 8;
                 this.label15.Text = "State:";
                 //
                 // label14
                 //
                 this.label14.Location = new System.Drawing.Point(256, 56);
                 this.label14.Name = "label14";
                 this.label14.Size = new System.Drawing.Size(64, 24);
                 this.label14.TabIndex = 7;
                 this.label14.Text = "ID Number:";
                 //
                 // label13
                 //
                 this.label13.Location = new System.Drawing.Point(240, 24);
                 this.label13.Name = "label13";
                 this.label13.Size = new System.Drawing.Size(128, 16);
                 this.label13.TabIndex = 6;
                 this.label13.Text = "Licence Information:";
                 //
                 // address
                 //
                 this.address.Location = new System.Drawing.Point(72, 168);
                 this.address.Name = "address";
                 this.address.Size = new System.Drawing.Size(160, 20);
                 this.address.TabIndex = 5;
                 this.address.Text = "";
                 //
                 // name
                 //
                 this.name.Location = new System.Drawing.Point(72, 112);
                 this.name.Name = "name";
                 this.name.Size = new System.Drawing.Size(160, 20);
                 this.name.TabIndex = 4;
                 this.name.Text = "";
                 //
                 // id
                 //
                 this.id.Location = new System.Drawing.Point(72, 56);
                 this.id.Name = "id";
                 this.id.Size = new System.Drawing.Size(160, 20);
                 this.id.TabIndex = 3;
                 this.id.Text = "";
                 //
                 // label12
                 //
                 this.label12.Location = new System.Drawing.Point(8, 168);
                 this.label12.Name = "label12";
                 this.label12.Size = new System.Drawing.Size(56, 16);
                 this.label12.TabIndex = 2;
                 this.label12.Text = "Address:";
                 //
                 // label11
                 //
                 this.label11.Location = new System.Drawing.Point(16, 112);
                 this.label11.Name = "label11";
                 this.label11.Size = new System.Drawing.Size(40, 16);
                 this.label11.TabIndex = 1;
                 this.label11.Text = "Name:";
                 //
                 // label10
                 //
                 this.label10.Location = new System.Drawing.Point(16, 56);
                 this.label10.Name = "label10";
                 this.label10.Size = new System.Drawing.Size(24, 16);
                 this.label10.TabIndex = 0;
                 this.label10.Text = "ID:";
                 //
                 // borrowedamount
                 //
                 this.borrowedamount.Contro ls.Add(thi s.interest rate);
                 this.borrowedamount.Contro ls.Add(thi s.taxrate) ;
                 this.borrowedamount.Contro ls.Add(thi s.monthlyp ayment);
                 this.borrowedamount.Contro ls.Add(thi s.numberof months);
                 this.borrowedamount.Contro ls.Add(thi s.textBox1 0);
                 this.borrowedamount.Contro ls.Add(thi s.textBox9 );
                 this.borrowedamount.Contro ls.Add(thi s.textBox8 );
                 this.borrowedamount.Contro ls.Add(thi s.textBox7 );
                 this.borrowedamount.Contro ls.Add(thi s.taxamoun t);
                 this.borrowedamount.Contro ls.Add(thi s.downpaym ent);
                 this.borrowedamount.Contro ls.Add(thi s.label30) ;
                 this.borrowedamount.Contro ls.Add(thi s.label29) ;
                 this.borrowedamount.Contro ls.Add(thi s.label28) ;
                 this.borrowedamount.Contro ls.Add(thi s.label25) ;
                 this.borrowedamount.Contro ls.Add(thi s.label24) ;
                 this.borrowedamount.Contro ls.Add(thi s.label20) ;
                 this.borrowedamount.Contro ls.Add(thi s.label18) ;
                 this.borrowedamount.Contro ls.Add(thi s.label17) ;
                 this.borrowedamount.Contro ls.Add(thi s.label19) ;
                 this.borrowedamount.Contro ls.Add(thi s.label21) ;
                 this.borrowedamount.Contro ls.Add(thi s.label23) ;
                 this.borrowedamount.Contro ls.Add(thi s.label27) ;
                 this.borrowedamount.Locati on = new System.Drawing.Point(288, 240);
                 this.borrowedamount.Name = "borrowedamount";
                 this.borrowedamount.Size = new System.Drawing.Size(528, 272);
                 this.borrowedamount.TabInd ex = 7;
                 this.borrowedamount.TabSto p = false;
                 this.borrowedamount.Text = "Load Information";
                 //
                 // interestrate
                 //
                 this.interestrate.Location = new System.Drawing.Point(368, 216);
                 this.interestrate.Name = "interestrate";
                 this.interestrate.Size = new System.Drawing.Size(128, 20);
                 this.interestrate.TabIndex = 17;
                 this.interestrate.Text = "";
                 //
                 // taxrate
                 //
                 this.taxrate.Location = new System.Drawing.Point(368, 168);
                 this.taxrate.Name = "taxrate";
                 this.taxrate.Size = new System.Drawing.Size(128, 20);
                 this.taxrate.TabIndex = 16;
                 this.taxrate.Text = "";
                 //
                 // monthlypayment
                 //
                 this.monthlypayment.Locati on = new System.Drawing.Point(368, 120);
                 this.monthlypayment.Name = "monthlypayment";
                 this.monthlypayment.Size = new System.Drawing.Size(128, 20);
                 this.monthlypayment.TabInd ex = 15;
                 this.monthlypayment.Text = "";
                 //
                 // numberofmonths
                 //
                 this.numberofmonths.Locati on = new System.Drawing.Point(368, 72);
                 this.numberofmonths.Name = "numberofmonths";
                 this.numberofmonths.Size = new System.Drawing.Size(128, 20);
                 this.numberofmonths.TabInd ex = 14;
                 this.numberofmonths.Text = "";
                 //
                 // textBox10
                 //
                 this.textBox10.Location = new System.Drawing.Point(368, 24);
                 this.textBox10.Name = "textBox10";
                 this.textBox10.Size = new System.Drawing.Size(128, 20);
                 this.textBox10.TabIndex = 13;
                 this.textBox10.Text = "";
                 //
                 // textBox9
                 //
                 this.textBox9.Location = new System.Drawing.Point(120, 216);
                 this.textBox9.Name = "textBox9";
                 this.textBox9.Size = new System.Drawing.Size(128, 20);
                 this.textBox9.TabIndex = 12;
                 this.textBox9.Text = "";
                 //
                 // textBox8
                 //
                 this.textBox8.Location = new System.Drawing.Point(120, 160);
                 this.textBox8.Name = "textBox8";
                 this.textBox8.Size = new System.Drawing.Size(128, 20);
                 this.textBox8.TabIndex = 11;
                 this.textBox8.Text = "";
                 //
                 // textBox7
                 //
                 this.textBox7.Location = new System.Drawing.Point(120, 112);
                 this.textBox7.Name = "textBox7";
                 this.textBox7.Size = new System.Drawing.Size(128, 20);
                 this.textBox7.TabIndex = 10;
                 this.textBox7.Text = "";
                 //
                 // taxamount
                 //
                 this.taxamount.Location = new System.Drawing.Point(120, 64);
                 this.taxamount.Name = "taxamount";
                 this.taxamount.Size = new System.Drawing.Size(128, 20);
                 this.taxamount.TabIndex = 9;
                 this.taxamount.Text = "";
                 //
                 // downpayment
                 //
                 this.downpayment.Location = new System.Drawing.Point(120, 24);
                 this.downpayment.Name = "downpayment";
                 this.downpayment.Size = new System.Drawing.Size(128, 20);
                 this.downpayment.TabIndex = 8;
                 this.downpayment.Text = "";
                 //
                 // label30
                 //
                 this.label30.Location = new System.Drawing.Point(264, 224);
                 this.label30.Name = "label30";
                 this.label30.Size = new System.Drawing.Size(88, 24);
                 this.label30.TabIndex = 7;
                 this.label30.Text = "Interest Rate:";
                 //
                 // label29
                 //
                 this.label29.Location = new System.Drawing.Point(264, 168);
                 this.label29.Name = "label29";
                 this.label29.Size = new System.Drawing.Size(88, 24);
                 this.label29.TabIndex = 6;
                 this.label29.Text = "Tax Rate:";
                 //
                 // label28
                 //
                 this.label28.Location = new System.Drawing.Point(264, 120);
                 this.label28.Name = "label28";
                 this.label28.Size = new System.Drawing.Size(96, 24);
                 this.label28.TabIndex = 5;
                 this.label28.Text = "Monthly Payment:";
                 //
                 // label25
                 //
                 this.label25.Location = new System.Drawing.Point(16, 160);
                 this.label25.Name = "label25";
                 this.label25.Size = new System.Drawing.Size(104, 24);
                 this.label25.TabIndex = 4;
                 this.label25.Text = "Borrowed Amount:";
                 //
                 // label24
                 //
                 this.label24.Location = new System.Drawing.Point(16, 224);
                 this.label24.Name = "label24";
                 this.label24.Size = new System.Drawing.Size(88, 24);
                 this.label24.TabIndex = 3;
                 this.label24.Text = "Interest Amount:";
                 //
                 // label20
                 //
                 this.label20.Location = new System.Drawing.Point(264, 24);
                 this.label20.Name = "label20";
                 this.label20.Size = new System.Drawing.Size(80, 24);
                 this.label20.TabIndex = 2;
                 this.label20.Text = "Loan Amount:";
                 //
                 // label18
                 //
                 this.label18.Location = new System.Drawing.Point(264, 72);
                 this.label18.Name = "label18";
                 this.label18.Size = new System.Drawing.Size(104, 24);
                 this.label18.TabIndex = 1;
                 this.label18.Text = "Number of Months:";
                 //
                 // label17
                 //
                 this.label17.Location = new System.Drawing.Point(16, 24);
                 this.label17.Name = "label17";
                 this.label17.Size = new System.Drawing.Size(88, 24);
                 this.label17.TabIndex = 0;
                 this.label17.Text = "Down Payment:";
                 //
                 // label19
                 //
                 this.label19.Location = new System.Drawing.Point(16, 64);
                 this.label19.Name = "label19";
                 this.label19.Size = new System.Drawing.Size(88, 24);
                 this.label19.TabIndex = 1;
                 this.label19.Text = "Tax Amount:";
                 //
                 // label21
                 //
                 this.label21.Location = new System.Drawing.Point(16, 112);
                 this.label21.Name = "label21";
                 this.label21.Size = new System.Drawing.Size(88, 24);
                 this.label21.TabIndex = 2;
                 this.label21.Text = "Total Cost:";
                 //
                 // label23
                 //
                 this.label23.Location = new System.Drawing.Point(16, 72);
                 this.label23.Name = "label23";
                 this.label23.Size = new System.Drawing.Size(88, 16);
                 this.label23.TabIndex = 1;
                 this.label23.Text = "label18";
                 //
                 // label27
                 //
                 this.label27.Location = new System.Drawing.Point(16, 72);
                 this.label27.Name = "label27";
                 this.label27.Size = new System.Drawing.Size(88, 24);
                 this.label27.TabIndex = 1;
                 this.label27.Text = "label18";
                 //
                 // Form1
                 //
                 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
                 this.ClientSize = new System.Drawing.Size(848, 534);
                 this.Controls.Add(this.bor rowedamoun t);
                 this.Controls.Add(this.cus tomerinfor mation);
                 this.Controls.Add(this.gro upBox1);
                 this.Controls.Add(this.but ton1);
                 this.Controls.Add(this.sal edate);
                 this.Controls.Add(this.rec ordnumber) ;
                 this.Controls.Add(this.lab el2);
                 this.Controls.Add(this.lab el1);
                 this.Name = "Form1";
                 this.Load += new System.EventHandler(this.F orm1_Load) ;
                 this.groupBox1.ResumeLayou t(false);
                 this.customerinformation.R esumeLayou t(false);
                 this.borrowedamount.Resume Layout(fal se);
                 this.ResumeLayout(false);
           }
           #endregion
           /// <summary>
           /// The main entry point for the application.
           /// </summary>
           [STAThread]
           static void Main()
           {
                 ReadSales();
                Â
                 Application.Run(new Form1());
           }
           public static void ReadSales()
           {
                 try
                 {
                      StreamReader fileReader;
                      string fileName = "sales.txt";
      Â
                      fileReader = new StreamReader(fileName);
                      string sLine;
                      string [] split;                      Â
                      const char delm = '|';
                      // get the first line
                      sLine = fileReader.ReadLine();
                      while (sLine != null)
                      {        Â
                            // process the current line           Â
                            split = sLine.Split(delm);
                            string date = split[0];
                            string ids = split[1];
                            string sn = split[2];
                            double dp = double.Parse(split[3]);
                            double nom = double.Parse(split[4]);
                     Â
                            // get the next line
                            sLine = fileReader.ReadLine();
                      }
                 }
                 catch(FileNotFoundExceptio n)
                 {
                      MessageBox.Show( "File sales.txt Does Not Exist", "Error",
                            MessageBoxButtons.OK, MessageBoxIcon.Error );
                 }
           }
      }
}
Below is the Form1.cs class which reads in the file
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Runtime.Serializati
using System.Runtime.Serializati
namespace WindowsApplication2
{
      [Serializable]
      public class Form1 : System.Windows.Forms.Form
      {
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.TextB
           private System.Windows.Forms.Butto
           private System.Windows.Forms.Group
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.Group
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.Label
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.Group
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           private System.Windows.Forms.TextB
           /// <summary>
           /// Required designer variable.
           /// </summary>
           private System.ComponentModel.Cont
           public Form1()
           {
                 //
                 // Required for Windows Form Designer support
                 //
                 InitializeComponent();
                 //
                 // TODO: Add any constructor code after InitializeComponent call
                 //
           }
           /// <summary>
           /// Clean up any resources being used.
           /// </summary>
           protected override void Dispose( bool disposing )
           {
                 if( disposing )
                 {
                      if (components != null)
                      {
                            components.Dispose();
                      }
                 }
                 base.Dispose( disposing );
           }
           #region Windows Form Designer generated code
           /// <summary>
           /// Required method for Designer support - do not modify
           /// the contents of this method with the code editor.
           /// </summary>
           private void InitializeComponent()
           {
                 this.label1 = new System.Windows.Forms.Label
                 this.label2 = new System.Windows.Forms.Label
                 this.recordnumber = new System.Windows.Forms.TextB
                 this.saledate = new System.Windows.Forms.TextB
                 this.button1 = new System.Windows.Forms.Butto
                 this.groupBox1 = new System.Windows.Forms.Group
                 this.price = new System.Windows.Forms.TextB
                 this.mileage = new System.Windows.Forms.TextB
                 this.textBox6 = new System.Windows.Forms.TextB
                 this.year = new System.Windows.Forms.TextB
                 this.model = new System.Windows.Forms.TextB
                 this.maker = new System.Windows.Forms.TextB
                 this.textBox2 = new System.Windows.Forms.TextB
                 this.label9 = new System.Windows.Forms.Label
                 this.label8 = new System.Windows.Forms.Label
                 this.label7 = new System.Windows.Forms.Label
                 this.label6 = new System.Windows.Forms.Label
                 this.label5 = new System.Windows.Forms.Label
                 this.label4 = new System.Windows.Forms.Label
                 this.label3 = new System.Windows.Forms.Label
                 this.customerinformation = new System.Windows.Forms.Group
                 this.expdate = new System.Windows.Forms.TextB
                 this.textBox4 = new System.Windows.Forms.TextB
                 this.idnumber = new System.Windows.Forms.TextB
                 this.label16 = new System.Windows.Forms.Label
                 this.label15 = new System.Windows.Forms.Label
                 this.label14 = new System.Windows.Forms.Label
                 this.label13 = new System.Windows.Forms.Label
                 this.address = new System.Windows.Forms.TextB
                 this.name = new System.Windows.Forms.TextB
                 this.id = new System.Windows.Forms.TextB
                 this.label12 = new System.Windows.Forms.Label
                 this.label11 = new System.Windows.Forms.Label
                 this.label10 = new System.Windows.Forms.Label
                 this.borrowedamount = new System.Windows.Forms.Group
                 this.interestrate = new System.Windows.Forms.TextB
                 this.taxrate = new System.Windows.Forms.TextB
                 this.monthlypayment = new System.Windows.Forms.TextB
                 this.numberofmonths = new System.Windows.Forms.TextB
                 this.textBox10 = new System.Windows.Forms.TextB
                 this.textBox9 = new System.Windows.Forms.TextB
                 this.textBox8 = new System.Windows.Forms.TextB
                 this.textBox7 = new System.Windows.Forms.TextB
                 this.taxamount = new System.Windows.Forms.TextB
                 this.downpayment = new System.Windows.Forms.TextB
                 this.label30 = new System.Windows.Forms.Label
                 this.label29 = new System.Windows.Forms.Label
                 this.label28 = new System.Windows.Forms.Label
                 this.label25 = new System.Windows.Forms.Label
                 this.label24 = new System.Windows.Forms.Label
                 this.label20 = new System.Windows.Forms.Label
                 this.label18 = new System.Windows.Forms.Label
                 this.label17 = new System.Windows.Forms.Label
                 this.label19 = new System.Windows.Forms.Label
                 this.label21 = new System.Windows.Forms.Label
                 this.label23 = new System.Windows.Forms.Label
                 this.label27 = new System.Windows.Forms.Label
                 this.groupBox1.SuspendLayo
                 this.customerinformation.S
                 this.borrowedamount.Suspen
                 this.SuspendLayout();
                 //
                 // label1
                 //
                 this.label1.Location = new System.Drawing.Point(16, 24);
                 this.label1.Name = "label1";
                 this.label1.Size = new System.Drawing.Size(88, 16);
                 this.label1.TabIndex = 0;
                 this.label1.Text = "Record Number:";
                 //
                 // label2
                 //
                 this.label2.Location = new System.Drawing.Point(16, 64);
                 this.label2.Name = "label2";
                 this.label2.Size = new System.Drawing.Size(64, 16);
                 this.label2.TabIndex = 1;
                 this.label2.Text = "Sale Date:";
                 //
                 // recordnumber
                 //
                 this.recordnumber.Location
                 this.recordnumber.Name = "recordnumber";
                 this.recordnumber.Size = new System.Drawing.Size(104, 20);
                 this.recordnumber.TabIndex
                 this.recordnumber.Text = "";
                 this.recordnumber.TextChan
                 //
                 // saledate
                 //
                 this.saledate.Location = new System.Drawing.Point(120, 64);
                 this.saledate.Name = "saledate";
                 this.saledate.Size = new System.Drawing.Size(104, 20);
                 this.saledate.TabIndex = 3;
                 this.saledate.Text = "";
                 //
                 // button1
                 //
                 this.button1.Location = new System.Drawing.Point(72, 112);
                 this.button1.Name = "button1";
                 this.button1.Size = new System.Drawing.Size(128, 40);
                 this.button1.TabIndex = 4;
                 this.button1.Text = "Next";
                 this.button1.Click += new System.EventHandler(this.b
                 //
                 // groupBox1
                 //
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Controls.Ad
                 this.groupBox1.Location = new System.Drawing.Point(16, 168);
                 this.groupBox1.Name = "groupBox1";
                 this.groupBox1.Size = new System.Drawing.Size(256, 344);
                 this.groupBox1.TabIndex = 5;
                 this.groupBox1.TabStop = false;
                 this.groupBox1.Text = "Car Information";
                 //
                 // price
                 //
                 this.price.Location = new System.Drawing.Point(112, 312);
                 this.price.Name = "price";
                 this.price.Size = new System.Drawing.Size(128, 20);
                 this.price.TabIndex = 14;
                 this.price.Text = "";
                 //
                 // mileage
                 //
                 this.mileage.Location = new System.Drawing.Point(112, 264);
                 this.mileage.Name = "mileage";
                 this.mileage.Size = new System.Drawing.Size(128, 20);
                 this.mileage.TabIndex = 13;
                 this.mileage.Text = "";
                 //
                 // textBox6
                 //
                 this.textBox6.Location = new System.Drawing.Point(112, 216);
                 this.textBox6.Name = "textBox6";
                 this.textBox6.Size = new System.Drawing.Size(128, 20);
                 this.textBox6.TabIndex = 12;
                 this.textBox6.Text = "";
                 //
                 // year
                 //
                 this.year.Location = new System.Drawing.Point(112, 168);
                 this.year.Name = "year";
                 this.year.Size = new System.Drawing.Size(128, 20);
                 this.year.TabIndex = 11;
                 this.year.Text = "";
                 //
                 // model
                 //
                 this.model.Location = new System.Drawing.Point(112, 120);
                 this.model.Name = "model";
                 this.model.Size = new System.Drawing.Size(128, 20);
                 this.model.TabIndex = 10;
                 this.model.Text = "";
                 //
                 // maker
                 //
                 this.maker.Location = new System.Drawing.Point(112, 72);
                 this.maker.Name = "maker";
                 this.maker.Size = new System.Drawing.Size(128, 20);
                 this.maker.TabIndex = 9;
                 this.maker.Text = "";
                 //
                 // textBox2
                 //
                 this.textBox2.Location = new System.Drawing.Point(112, 32);
                 this.textBox2.Name = "textBox2";
                 this.textBox2.Size = new System.Drawing.Size(128, 20);
                 this.textBox2.TabIndex = 8;
                 this.textBox2.Text = "";
                 //
                 // label9
                 //
                 this.label9.Location = new System.Drawing.Point(8, 312);
                 this.label9.Name = "label9";
                 this.label9.Size = new System.Drawing.Size(40, 16);
                 this.label9.TabIndex = 7;
                 this.label9.Text = "Price:";
                 //
                 // label8
                 //
                 this.label8.Location = new System.Drawing.Point(8, 272);
                 this.label8.Name = "label8";
                 this.label8.Size = new System.Drawing.Size(48, 16);
                 this.label8.TabIndex = 6;
                 this.label8.Text = "Mileage:";
                 //
                 // label7
                 //
                 this.label7.Location = new System.Drawing.Point(8, 224);
                 this.label7.Name = "label7";
                 this.label7.Size = new System.Drawing.Size(40, 16);
                 this.label7.TabIndex = 5;
                 this.label7.Text = "Color:";
                 //
                 // label6
                 //
                 this.label6.Location = new System.Drawing.Point(8, 176);
                 this.label6.Name = "label6";
                 this.label6.Size = new System.Drawing.Size(40, 16);
                 this.label6.TabIndex = 4;
                 this.label6.Text = "Year:";
                 //
                 // label5
                 //
                 this.label5.Location = new System.Drawing.Point(8, 128);
                 this.label5.Name = "label5";
                 this.label5.Size = new System.Drawing.Size(40, 16);
                 this.label5.TabIndex = 3;
                 this.label5.Text = "Model:";
                 //
                 // label4
                 //
                 this.label4.Location = new System.Drawing.Point(8, 80);
                 this.label4.Name = "label4";
                 this.label4.Size = new System.Drawing.Size(40, 16);
                 this.label4.TabIndex = 2;
                 this.label4.Text = "Maker:";
                 //
                 // label3
                 //
                 this.label3.Location = new System.Drawing.Point(8, 32);
                 this.label3.Name = "label3";
                 this.label3.Size = new System.Drawing.Size(88, 16);
                 this.label3.TabIndex = 1;
                 this.label3.Text = "Stock Number:";
                 //
                 // customerinformation
                 //
                 this.customerinformation.C
                 this.customerinformation.C
                 this.customerinformation.C
                 this.customerinformation.C
                 this.customerinformation.C
                 this.customerinformation.C
                 this.customerinformation.C
                 this.customerinformation.C
                 this.customerinformation.C
                 this.customerinformation.C
                 this.customerinformation.C
                 this.customerinformation.C
                 this.customerinformation.C
                 this.customerinformation.L
                 this.customerinformation.N
                 this.customerinformation.S
                 this.customerinformation.T
                 this.customerinformation.T
                 this.customerinformation.T
                 //
                 // expdate
                 //
                 this.expdate.Location = new System.Drawing.Point(344, 160);
                 this.expdate.Name = "expdate";
                 this.expdate.Size = new System.Drawing.Size(152, 20);
                 this.expdate.TabIndex = 12;
                 this.expdate.Text = "";
                 //
                 // textBox4
                 //
                 this.textBox4.Location = new System.Drawing.Point(344, 104);
                 this.textBox4.Name = "textBox4";
                 this.textBox4.Size = new System.Drawing.Size(152, 20);
                 this.textBox4.TabIndex = 11;
                 this.textBox4.Text = "";
                 //
                 // idnumber
                 //
                 this.idnumber.Location = new System.Drawing.Point(344, 56);
                 this.idnumber.Name = "idnumber";
                 this.idnumber.Size = new System.Drawing.Size(152, 20);
                 this.idnumber.TabIndex = 10;
                 this.idnumber.Text = "";
                 //
                 // label16
                 //
                 this.label16.Location = new System.Drawing.Point(256, 160);
                 this.label16.Name = "label16";
                 this.label16.Size = new System.Drawing.Size(64, 24);
                 this.label16.TabIndex = 9;
                 this.label16.Text = "Exp. Date:";
                 //
                 // label15
                 //
                 this.label15.Location = new System.Drawing.Point(256, 112);
                 this.label15.Name = "label15";
                 this.label15.Size = new System.Drawing.Size(40, 24);
                 this.label15.TabIndex = 8;
                 this.label15.Text = "State:";
                 //
                 // label14
                 //
                 this.label14.Location = new System.Drawing.Point(256, 56);
                 this.label14.Name = "label14";
                 this.label14.Size = new System.Drawing.Size(64, 24);
                 this.label14.TabIndex = 7;
                 this.label14.Text = "ID Number:";
                 //
                 // label13
                 //
                 this.label13.Location = new System.Drawing.Point(240, 24);
                 this.label13.Name = "label13";
                 this.label13.Size = new System.Drawing.Size(128, 16);
                 this.label13.TabIndex = 6;
                 this.label13.Text = "Licence Information:";
                 //
                 // address
                 //
                 this.address.Location = new System.Drawing.Point(72, 168);
                 this.address.Name = "address";
                 this.address.Size = new System.Drawing.Size(160, 20);
                 this.address.TabIndex = 5;
                 this.address.Text = "";
                 //
                 // name
                 //
                 this.name.Location = new System.Drawing.Point(72, 112);
                 this.name.Name = "name";
                 this.name.Size = new System.Drawing.Size(160, 20);
                 this.name.TabIndex = 4;
                 this.name.Text = "";
                 //
                 // id
                 //
                 this.id.Location = new System.Drawing.Point(72, 56);
                 this.id.Name = "id";
                 this.id.Size = new System.Drawing.Size(160, 20);
                 this.id.TabIndex = 3;
                 this.id.Text = "";
                 //
                 // label12
                 //
                 this.label12.Location = new System.Drawing.Point(8, 168);
                 this.label12.Name = "label12";
                 this.label12.Size = new System.Drawing.Size(56, 16);
                 this.label12.TabIndex = 2;
                 this.label12.Text = "Address:";
                 //
                 // label11
                 //
                 this.label11.Location = new System.Drawing.Point(16, 112);
                 this.label11.Name = "label11";
                 this.label11.Size = new System.Drawing.Size(40, 16);
                 this.label11.TabIndex = 1;
                 this.label11.Text = "Name:";
                 //
                 // label10
                 //
                 this.label10.Location = new System.Drawing.Point(16, 56);
                 this.label10.Name = "label10";
                 this.label10.Size = new System.Drawing.Size(24, 16);
                 this.label10.TabIndex = 0;
                 this.label10.Text = "ID:";
                 //
                 // borrowedamount
                 //
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Contro
                 this.borrowedamount.Locati
                 this.borrowedamount.Name = "borrowedamount";
                 this.borrowedamount.Size = new System.Drawing.Size(528, 272);
                 this.borrowedamount.TabInd
                 this.borrowedamount.TabSto
                 this.borrowedamount.Text = "Load Information";
                 //
                 // interestrate
                 //
                 this.interestrate.Location
                 this.interestrate.Name = "interestrate";
                 this.interestrate.Size = new System.Drawing.Size(128, 20);
                 this.interestrate.TabIndex
                 this.interestrate.Text = "";
                 //
                 // taxrate
                 //
                 this.taxrate.Location = new System.Drawing.Point(368, 168);
                 this.taxrate.Name = "taxrate";
                 this.taxrate.Size = new System.Drawing.Size(128, 20);
                 this.taxrate.TabIndex = 16;
                 this.taxrate.Text = "";
                 //
                 // monthlypayment
                 //
                 this.monthlypayment.Locati
                 this.monthlypayment.Name = "monthlypayment";
                 this.monthlypayment.Size = new System.Drawing.Size(128, 20);
                 this.monthlypayment.TabInd
                 this.monthlypayment.Text = "";
                 //
                 // numberofmonths
                 //
                 this.numberofmonths.Locati
                 this.numberofmonths.Name = "numberofmonths";
                 this.numberofmonths.Size = new System.Drawing.Size(128, 20);
                 this.numberofmonths.TabInd
                 this.numberofmonths.Text = "";
                 //
                 // textBox10
                 //
                 this.textBox10.Location = new System.Drawing.Point(368, 24);
                 this.textBox10.Name = "textBox10";
                 this.textBox10.Size = new System.Drawing.Size(128, 20);
                 this.textBox10.TabIndex = 13;
                 this.textBox10.Text = "";
                 //
                 // textBox9
                 //
                 this.textBox9.Location = new System.Drawing.Point(120, 216);
                 this.textBox9.Name = "textBox9";
                 this.textBox9.Size = new System.Drawing.Size(128, 20);
                 this.textBox9.TabIndex = 12;
                 this.textBox9.Text = "";
                 //
                 // textBox8
                 //
                 this.textBox8.Location = new System.Drawing.Point(120, 160);
                 this.textBox8.Name = "textBox8";
                 this.textBox8.Size = new System.Drawing.Size(128, 20);
                 this.textBox8.TabIndex = 11;
                 this.textBox8.Text = "";
                 //
                 // textBox7
                 //
                 this.textBox7.Location = new System.Drawing.Point(120, 112);
                 this.textBox7.Name = "textBox7";
                 this.textBox7.Size = new System.Drawing.Size(128, 20);
                 this.textBox7.TabIndex = 10;
                 this.textBox7.Text = "";
                 //
                 // taxamount
                 //
                 this.taxamount.Location = new System.Drawing.Point(120, 64);
                 this.taxamount.Name = "taxamount";
                 this.taxamount.Size = new System.Drawing.Size(128, 20);
                 this.taxamount.TabIndex = 9;
                 this.taxamount.Text = "";
                 //
                 // downpayment
                 //
                 this.downpayment.Location = new System.Drawing.Point(120, 24);
                 this.downpayment.Name = "downpayment";
                 this.downpayment.Size = new System.Drawing.Size(128, 20);
                 this.downpayment.TabIndex = 8;
                 this.downpayment.Text = "";
                 //
                 // label30
                 //
                 this.label30.Location = new System.Drawing.Point(264, 224);
                 this.label30.Name = "label30";
                 this.label30.Size = new System.Drawing.Size(88, 24);
                 this.label30.TabIndex = 7;
                 this.label30.Text = "Interest Rate:";
                 //
                 // label29
                 //
                 this.label29.Location = new System.Drawing.Point(264, 168);
                 this.label29.Name = "label29";
                 this.label29.Size = new System.Drawing.Size(88, 24);
                 this.label29.TabIndex = 6;
                 this.label29.Text = "Tax Rate:";
                 //
                 // label28
                 //
                 this.label28.Location = new System.Drawing.Point(264, 120);
                 this.label28.Name = "label28";
                 this.label28.Size = new System.Drawing.Size(96, 24);
                 this.label28.TabIndex = 5;
                 this.label28.Text = "Monthly Payment:";
                 //
                 // label25
                 //
                 this.label25.Location = new System.Drawing.Point(16, 160);
                 this.label25.Name = "label25";
                 this.label25.Size = new System.Drawing.Size(104, 24);
                 this.label25.TabIndex = 4;
                 this.label25.Text = "Borrowed Amount:";
                 //
                 // label24
                 //
                 this.label24.Location = new System.Drawing.Point(16, 224);
                 this.label24.Name = "label24";
                 this.label24.Size = new System.Drawing.Size(88, 24);
                 this.label24.TabIndex = 3;
                 this.label24.Text = "Interest Amount:";
                 //
                 // label20
                 //
                 this.label20.Location = new System.Drawing.Point(264, 24);
                 this.label20.Name = "label20";
                 this.label20.Size = new System.Drawing.Size(80, 24);
                 this.label20.TabIndex = 2;
                 this.label20.Text = "Loan Amount:";
                 //
                 // label18
                 //
                 this.label18.Location = new System.Drawing.Point(264, 72);
                 this.label18.Name = "label18";
                 this.label18.Size = new System.Drawing.Size(104, 24);
                 this.label18.TabIndex = 1;
                 this.label18.Text = "Number of Months:";
                 //
                 // label17
                 //
                 this.label17.Location = new System.Drawing.Point(16, 24);
                 this.label17.Name = "label17";
                 this.label17.Size = new System.Drawing.Size(88, 24);
                 this.label17.TabIndex = 0;
                 this.label17.Text = "Down Payment:";
                 //
                 // label19
                 //
                 this.label19.Location = new System.Drawing.Point(16, 64);
                 this.label19.Name = "label19";
                 this.label19.Size = new System.Drawing.Size(88, 24);
                 this.label19.TabIndex = 1;
                 this.label19.Text = "Tax Amount:";
                 //
                 // label21
                 //
                 this.label21.Location = new System.Drawing.Point(16, 112);
                 this.label21.Name = "label21";
                 this.label21.Size = new System.Drawing.Size(88, 24);
                 this.label21.TabIndex = 2;
                 this.label21.Text = "Total Cost:";
                 //
                 // label23
                 //
                 this.label23.Location = new System.Drawing.Point(16, 72);
                 this.label23.Name = "label23";
                 this.label23.Size = new System.Drawing.Size(88, 16);
                 this.label23.TabIndex = 1;
                 this.label23.Text = "label18";
                 //
                 // label27
                 //
                 this.label27.Location = new System.Drawing.Point(16, 72);
                 this.label27.Name = "label27";
                 this.label27.Size = new System.Drawing.Size(88, 24);
                 this.label27.TabIndex = 1;
                 this.label27.Text = "label18";
                 //
                 // Form1
                 //
                 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
                 this.ClientSize = new System.Drawing.Size(848, 534);
                 this.Controls.Add(this.bor
                 this.Controls.Add(this.cus
                 this.Controls.Add(this.gro
                 this.Controls.Add(this.but
                 this.Controls.Add(this.sal
                 this.Controls.Add(this.rec
                 this.Controls.Add(this.lab
                 this.Controls.Add(this.lab
                 this.Name = "Form1";
                 this.Load += new System.EventHandler(this.F
                 this.groupBox1.ResumeLayou
                 this.customerinformation.R
                 this.borrowedamount.Resume
                 this.ResumeLayout(false);
           }
           #endregion
           /// <summary>
           /// The main entry point for the application.
           /// </summary>
           [STAThread]
           static void Main()
           {
                 ReadSales();
                Â
                 Application.Run(new Form1());
           }
           public static void ReadSales()
           {
                 try
                 {
                      StreamReader fileReader;
                      string fileName = "sales.txt";
      Â
                      fileReader = new StreamReader(fileName);
                      string sLine;
                      string [] split;                      Â
                      const char delm = '|';
                      // get the first line
                      sLine = fileReader.ReadLine();
                      while (sLine != null)
                      {        Â
                            // process the current line           Â
                            split = sLine.Split(delm);
                            string date = split[0];
                            string ids = split[1];
                            string sn = split[2];
                            double dp = double.Parse(split[3]);
                            double nom = double.Parse(split[4]);
                     Â
                            // get the next line
                            sLine = fileReader.ReadLine();
                      }
                 }
                 catch(FileNotFoundExceptio
                 {
                      MessageBox.Show( "File sales.txt Does Not Exist", "Error",
                            MessageBoxButtons.OK, MessageBoxIcon.Error );
                 }
           }
      }
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER