瀏覽代碼

标签维护增加初始化打印程序加载窗口

shim 8 年之前
父節點
當前提交
847d6f1e0c
共有 1 個文件被更改,包括 20 次插入18 次删除
  1. 20 18
      UAS-MES/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.cs

+ 20 - 18
UAS-MES/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.cs

@@ -9,6 +9,7 @@ using System.Windows.Forms;
 using UAS_MES.CustomControl.TextBoxWithIcon;
 using UAS_MES.DataOperate;
 using UAS_MES.Properties;
+using UAS_MES.PublicForm;
 using UAS_MES.PublicMethod;
 
 namespace UAS_MES.SystemSetting
@@ -55,7 +56,7 @@ namespace UAS_MES.SystemSetting
         //添加在grid末列的操作列
         DataTable dbfind;
 
-
+        Thread InitPrint;
         DataGridViewImageColumn PerviewColumn = new DataGridViewImageColumn
         {
             Image = Resources.preview_16px_25980_easyicon_net,
@@ -85,28 +86,18 @@ namespace UAS_MES.SystemSetting
             InitializeComponent();
 
         }
-
-        //创建打印进程
-        private void NewPrint()
-        {
-            try
-            {
-                lbl = new ApplicationClass();
-            }
-            catch
-            {
-                MessageBox.Show("未正确安装CodeSoft软件");
-            }
-        }
-
+        
         private void 条码维护_Load(object sender, EventArgs e)
         {
-            thread = new Thread(NewPrint);
-            thread.Start();
             asc.controllInitializeSize(this);
             dh = new DataHelper();
             condition.Append(" ");
             LoadData();
+            //加loading框
+            InitPrint = new Thread(InPrint);
+            SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
+            BaseUtil.SetFormCenter(stw);
+            stw.ShowDialog();
 
             pr_code.FormName = Name;
             pr_code.SetValueField = new string[] { "pr_code" };
@@ -128,7 +119,18 @@ namespace UAS_MES.SystemSetting
             pr_detail.KeyDown += ScreenEvent;
             pr_spec.KeyDown += ScreenEvent;
         }
-
+        private void InPrint()
+        {
+            try
+            {
+                lbl = new ApplicationClass();
+                BaseUtil.WriteLbl(lbl);
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show("未正确安装codesoft");
+            }
+        }
         private void La_code_DbChange(object sender, EventArgs e)
         {
             dbfind = la_code.ReturnData;