private void displayToolStripMenuItem_Click(object sender, EventArgs e) { userInputWindow = new UserInputWindow(); lvf = new ListViewForm(); bool open = false; FormCollection fc = Application.OpenForms; foreach (Form frm in fc) { if (frm.Name == "ListViewForm") { open = true; frm.Select(); break; } } if (open == false) { lvf.Show(); displayToolStripMenuItem.Checked = true; // TODO: Re-size checked icon } lvf.UncheckToolStripMenuItem += UncheckToolStripMenuItemHandle; ClearMeAndListView += lvf.ClearMeAndListViewHandler; lvf.ClearMeAndTextBox += ClearMeAndTextBoxHandler; lvf.DisplayInputFormExistSecond += DisplayInputFormExistHandler; }
public void buttonNewInputWindow_Click(object sender, EventArgs e) { userInputWindow = new UserInputWindow(); lvf = new ListViewForm(); userInputWindow.ObjectAdded += ObjectAddedHandler; userInputWindow.DisplayObjectsStored += DisplayObjectsStoredHandler; userInputWindow.DisplayInputFormExist += DisplayInputFormExistHandler; userInputWindow.Show(); }
public void UncheckToolStripMenuItemHandle(object sender, EventArgs e) { lvf = new ListViewForm(); bool open = true; FormCollection fc = Application.OpenForms; foreach (Form frm in fc) { if (frm.Name == "ListViewForm") { open = false; frm.Select(); break; } } if (open == true) { lvf.Close(); displayToolStripMenuItem.Checked = false; } }
public void ClearMeAndTextBoxHandler(object sender, EventArgs e) { lvf = sender as ListViewForm; textBoxObjetsStoredInListView.Text = "0"; }