private void mnuOpen_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "*.tdb|*.tdb"; if (ofd.ShowDialog() != DialogResult.OK) { return; } if (!Tdb.LoadTdbFromFile(ofd.FileName)) { return; } lblFile.Text = ofd.FileName; lblFile.ForeColor = Control.DefaultForeColor; lblLine.Text = "-"; mnuSave.Enabled = true; mnuSaveAs.Enabled = true; listBox1.Items.Clear(); foreach (var t in Tdb.lstTdb) { listBox1.Items.Add(t.Item1); } txtSearch.Enabled = true; txtSearch.Clear(); btnNext.Enabled = false; lblSearchResults.Visible = false; }
private void mnuSave_Click(object sender, EventArgs e) { if (Tdb.SaveTdbToFile(lblFile.Text)) { lblFile.ForeColor = Color.Blue; } }
private void mnuSaveAs_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "*.tdb|*.tdb"; if (sfd.ShowDialog() != DialogResult.OK) { return; } if (Tdb.SaveTdbToFile(sfd.FileName)) { lblFile.Text = sfd.FileName; lblFile.ForeColor = Color.Blue; } }