Esempio n. 1
0
 public static void ShowInfo(IWin32Window owner, string text, float timeCloseSecond = 3.5f)
 {
     try
     {
         Control ctrl = owner as Control;
         if (ctrl == null)
         {
             Form main = Application.OpenForms[0];
             foreach (var item in Application.OpenForms)
             {
                 FrmMain form = item as FrmMain;
                 if (form != null)
                 {
                     main = form;
                     break;
                 }
             }
             ctrl = main;
         }
         ctrl.Invoke(new Action(() =>
         {
             FrmInfo frmInfo = new FrmInfo(text, timeCloseSecond);
             if (ctrl == null)
             {
                 frmInfo.Show();
             }
             else
             {
                 frmInfo.Show(ctrl);
             }
             frmInfo.Refresh();
         }));
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 2
0
 public static void ShowInfoWindow(IWin32Window owner, string text, float timeclose = 3.5f)
 {
     FrmInfo.ShowInfo(owner, text, timeclose);
 }