private void OnToolClicked(object sender, EventArgs e) { BlackBoxMainForm form = BlackBoxMainForm.Get(); Form owner = null; if (Application.OpenForms.Count > 0) { owner = Application.OpenForms[0]; } form.ShowDialog(owner); }
/// <summary> /// Called when the user clicks on the balloon. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnClick(object sender, EventArgs e) { BlackBoxMainForm form = BlackBoxMainForm.Get(); Form owner = null; if (Application.OpenForms.Count > 0) { owner = Application.OpenForms[0]; } if (owner == null) { form.ShowInTaskbar = true; form.Show(); } else { form.ShowDialog(owner); } }