Common.Forms.ModelessForm modifications.

This commit is contained in:
Milan Hanajik
2023-11-28 08:47:15 +01:00
committed by Milan Hanajik
parent ad2c1d615f
commit f747755301
7 changed files with 32 additions and 19 deletions
+7 -4
View File
@@ -23,6 +23,8 @@ namespace ProductionTracing
{
const string OpenFileDlg_SaveFileDlg_Filter = "{0} (*.que)|*.que|{1} (*.*)|*.*";
ModelessForm modelessForm;
string[] args;
FiltersConfig filtersConfig; /// Serializable configuration of filters and displayed results
QueryResults currentQR;
@@ -190,8 +192,9 @@ namespace ProductionTracing
private void executeQueryBtn_Click(object sender, EventArgs e)
{
UpdateAndSaveHistory();
Thread thread = new Thread(() => Application.Run(new Common.Forms.ModelessForm(Strings.searching)));
modelessForm = new ModelessForm(Strings.searching);
Thread thread = new Thread(() => Application.Run(modelessForm));
thread.CurrentCulture = CultureInfo.CurrentCulture;
thread.CurrentUICulture = CultureInfo.CurrentUICulture;
thread.Start();
@@ -220,7 +223,7 @@ namespace ProductionTracing
catch (Exception exc)
{
if (session != null && session.IsOpen) session.Close();
Common.Forms.ModelessForm.CloseForm();
if (modelessForm != null) modelessForm.CloseForm();
MessageBox.Show(exc.Message,
Strings.Error,
MessageBoxButtons.OK,
@@ -233,7 +236,7 @@ namespace ProductionTracing
tabControl.TabPages.Add(newTabPage);
tabControl.SelectTab(newTabPage);
Common.Forms.ModelessForm.CloseForm();
if (modelessForm != null) modelessForm.CloseForm();
}
/// <summary>