private void menuProjectNew_Click(object sender, EventArgs e) { // // Create the new project entry GPProject proj = new GPProject("New Project"); // // Bring up the project form fmProject project = new fmProject(proj); project.MdiParent = this; project.Show(); }
/// <summary> /// Determines if a project is already opened /// </summary> /// <param name="ProjectID">DBCode of the project in question</param> /// <returns>True if the project is opened, false otherwise</returns> public bool ProjectOpen(int ProjectID) { // // Go through the list of MDI windows foreach (Form fmChild in this.MdiChildren) { if (fmChild is fmProject) { fmProject fmProject = (fmProject)fmChild; if (fmProject.ProjectID == ProjectID) { return(true); } } } return(false); }
private void menuProjectOpen_Click(object sender, EventArgs e) { // // Bring up the list of project fmProjectManager dlg = new fmProjectManager(); if (dlg.ShowDialog(this) == DialogResult.OK) { // // Load up this project and bring up the Project form ListViewItem lvSelected = dlg.lvProjects.Items[dlg.lvProjects.SelectedItems[0].Index]; int ProjectID = Convert.ToInt32(lvSelected.Tag.ToString()); // // Load up the project GPProject proj = new GPProject("New Project"); proj.Load(ProjectID); // // Bring up the project form fmProject project = new fmProject(proj); project.MdiParent = this; project.Show(); } }