private void treeView1_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e) { if (e.Node.Parent != null) { TableEditForm tableForm = new TableEditForm(); tableForm.Text = tableForm.Name = e.Node.Text; tableForm.LoadTable(database, tableForm.Text); tableForm.MdiParent = this; tableForm.Show(); } }
//Closes all open forms //Closing the forms will also save them. //If the file is read only the changes will be lost and no warning will be displayed private void CloseForms() { if (!this.addTestForm.IsDisposed) { this.addTestForm.Dispose(); } while ((this.MdiChildren.Length > 0) && this.addTestForm.IsDisposed) { if ("SqliteGUI.TableEditForm" == this.MdiChildren[0].GetType().ToString()) { TableEditForm child = this.MdiChildren[0] as TableEditForm; child.SetDatabase(database); child.Close(); child = null; } } }