using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;


namespace Knobel
{   // Startfenster
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        // Spiel starten - Button
        // Startet Spiel, also Form1
        private void button1_Click(object sender, EventArgs e)
        {
            Form1 start = new Form1();
            // Fenster wird versteckt.
            // Falls man abbricht, kommt man auf Startfenster zurück
            this.Hide();
            if (start.ShowDialog() == DialogResult.OK)
            {
                this.Show();
            }
            
            
        }

        // Ende - Button
        private void button4_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }



        // Button - Anleitung
        private void button2_Click(object sender, EventArgs e)
        {
           // Pfad der Exe-Datei wird gesucht und in diesem Ordner "anleitung.bmp" geöffnet
           Process anleitung = new Process();
           string m = "anleitung.bmp";
           string s = Environment.CurrentDirectory.ToString();
           m.Insert(1, s);
           anleitung.StartInfo.FileName = m;
           anleitung.Start();


            
            
        }


        // Highscore - Button
        private void button3_Click(object sender, EventArgs e)
        {
            Form3 start3 = new Form3 ();
            
            // Einlesen der Textdatei
            string m = "Highscore.txt";
            string s = Environment.CurrentDirectory.ToString();
            m.Insert(1, s); // analog wie bei "Anleitung"

            StreamReader myReader = File.OpenText(m);

            try
            {
               
                start3.textBox2.Text = myReader.ReadLine();
                start3.textBox3.Text = myReader.ReadLine();
                start3.textBox7 .Text =myReader.ReadLine();
                start3.textBox5.Text = myReader.ReadLine();
                start3.textBox6.Text = myReader.ReadLine();
                start3.textBox8.Text = myReader.ReadLine();
                start3.textBox9.Text = myReader.ReadLine(); 
                start3.textBox11.Text = myReader.ReadLine();
                start3.textBox10.Text = myReader.ReadLine();
                start3.textBox12.Text = myReader.ReadLine();

            }
                
            finally { myReader.Close(); }

            
            if (start3.ShowDialog() == DialogResult.OK)
            {
                
            }
            
        }

        private void Form2_Load(object sender, EventArgs e)
        {

        }
    }
}
