示例#1
0
        private void History_Click(object sender, EventArgs e)
        {
            if (Category.Text != category || Amount.Text != amount || Commentary.Text != commentary)
            {
                DialogResult Result = MessageBox.Show("Все несохранённые данные будут потеряны. Продолжить?",
                                                      "Предупреждение", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                if (Result == DialogResult.No)
                {
                    //e.Cancel = true;
                    return;
                }
            }
            string[] file   = File.ReadAllLines(@"CurrentStateList.txt");
            string   delete = file[file.Length - 1];

            if (delete[delete.Length - 1] == ';')
            {
                //удаление последней строки файла, т.к. там записывалась часть инфы перед вызовом этой формы
                file = (from x in file where !x.Contains(delete) select x).ToArray();
                File.WriteAllLines(@"CurrentStateList.txt", file);
            }
            History_Screen HS = new History_Screen();

            HS.Show();
            HS.Location = this.Location;
            HS.Size     = this.Size;
            HS.Activate();
            this.Visible = false;
        }
        private void History_Record_Screen_Closed(object sender, FormClosedEventArgs e)
        {
            History_Screen HS = new History_Screen();

            HS.Show();
            HS.Location = this.Location;
            HS.Size     = this.Size;
            HS.Activate();
        }
示例#3
0
        private void History_Click(object sender, EventArgs e)
        {
            History_Screen HS = new History_Screen();

            HS.Show();
            HS.Location = this.Location; //чтобы окно открывалось в том же месте, где и окно, с которого совершён переход
            HS.Size     = this.Size;     //то же для размеров
            HS.Activate();
            this.Visible = false;
        }
示例#4
0
        private void History_Click(object sender, EventArgs e)
        {
            History_Screen HS = new History_Screen();

            HS.Show();
            HS.Location = this.Location;
            HS.Size     = this.Size;
            HS.Activate();
            this.Visible = false;
        }