Ejemplo n.º 1
0
        //Loads up a new file for the user to cycle through or edit if so wish
        private void btnLoad_Click(object sender, EventArgs e)
        {
            //loads new file
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.Title = "Open the text file you wish" ;
            //ofd.InitialDirectory = "c:\\";
            ofd.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" ;
            //string infile2 = infile;

            //infile = infile2;
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    Student[] pArray = new Student[10];
                    Read(ofd.FileName);
                    DisplayRecord(0);
                    lblmessage.Text = "New Data Loaded";

                }
        }
Ejemplo n.º 2
0
        //If The File Text box is focused and the user presses enter then the text within that box is used to load up an exsisting file
        private void txtfile_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {

                string NewFileName = txtfile.Text;

                    Student[] pArray = new Student[10];
                    Read(NewFileName);
                    DisplayRecord(0);
                    MessageBox.Show(NewFileName + " Was Loaded!!",NewFileName);
                    infile = NewFileName;
            }
        }
Ejemplo n.º 3
0
 public int SetStudetGrade( Student name ,int grade)
 {
     name.Grade = grade;
     return grade;
 }