private void ProcessInterface() { //LoadInterface(); //ShowForm(); //UnloadInterface(); frmInterface = new frmBooksMaster(); frmInterface.IsLookUpMode = true; DialogResult result; result = frmInterface.ShowDialog(); if (result == DialogResult.OK) { _bookID = frmInterface.BookID; } else { _bookID = ""; } frmInterface.Close(); frmInterface = null; }
/**/ public void ShowForm(string formName) { try { switch (formName) { case "UserRegistration": if (frmUserRegistration == null) { frmUserRegistration = new frmUserRegistration(); frmUserRegistration.MdiParent = this; frmUserRegistration.Show(); frmUserRegistration.BringToFront(); } else if (frmUserRegistration.IsDisposed == true) { frmUserRegistration = new frmUserRegistration(); frmUserRegistration.MdiParent = this; frmUserRegistration.Show(); frmUserRegistration.BringToFront(); } else { frmUserRegistration.Activate(); frmUserRegistration.Show(); frmUserRegistration.BringToFront(); } break; case "frmBooksMaster": if (frmBooksMaster == null) { frmBooksMaster = new frmBooksMaster(); frmBooksMaster.MdiParent = this; frmBooksMaster.Show(); frmBooksMaster.BringToFront(); } else if (frmBooksMaster.IsDisposed == true) { frmBooksMaster = new frmBooksMaster(); frmBooksMaster.MdiParent = this; frmBooksMaster.Show(); frmBooksMaster.BringToFront(); } else { frmBooksMaster.Activate(); frmBooksMaster.Show(); frmBooksMaster.BringToFront(); } break; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void UnloadInterface() { frmInterface.Close(); frmInterface = null; }
private void LoadInterface() { frmInterface = new frmBooksMaster(); frmInterface.IsLookUpMode = true; }