Browse Source

实例初始化窗体对象

wb_han 5 years ago
parent
commit
82f2771a80

+ 3 - 4
HOZProject/FormHOZMain.Designer.cs

@@ -176,10 +176,10 @@
             this.listmsg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.listmsg.FormattingEnabled = true;
             this.listmsg.ItemHeight = 12;
-            this.listmsg.Location = new System.Drawing.Point(426, 2);
+            this.listmsg.Location = new System.Drawing.Point(417, 2);
             this.listmsg.Margin = new System.Windows.Forms.Padding(2);
             this.listmsg.Name = "listmsg";
-            this.listmsg.Size = new System.Drawing.Size(466, 220);
+            this.listmsg.Size = new System.Drawing.Size(477, 196);
             this.listmsg.TabIndex = 18;
             this.listmsg.Visible = false;
             // 
@@ -208,9 +208,8 @@
             this.lblFlowContent.ForeColor = System.Drawing.Color.White;
             this.lblFlowContent.Location = new System.Drawing.Point(23, 38);
             this.lblFlowContent.Name = "lblFlowContent";
-            this.lblFlowContent.Size = new System.Drawing.Size(28, 14);
+            this.lblFlowContent.Size = new System.Drawing.Size(0, 14);
             this.lblFlowContent.TabIndex = 0;
-            this.lblFlowContent.Text = "---";
             // 
             // plLeft
             // 

+ 24 - 7
HOZProject/FormHOZMain.cs

@@ -135,12 +135,14 @@ namespace HOZProject
 
             //加载窗口移动事件
             this.MouseDown += new MouseEventHandler(FormHOZMain_MouseDown);
-            //plFill.MouseDown += new MouseEventHandler(FormHOZMain_MouseDown);
-            //plTop.MouseDown += new MouseEventHandler(FormHOZMain_MouseDown);
-            //plLeft.MouseDown += new MouseEventHandler(FormHOZMain_MouseDown);
-            //plLeftContent.MouseDown += new MouseEventHandler(FormHOZMain_MouseDown);
             //新建
             NewCreate();
+            //实例初始化窗体对象
+            if (uControl_Init == null)
+            {
+                uControl_Init = new UControl_Init(this);
+                uControl_Init.ReloadConfig();
+            }
         }
 
         #region 创建切孔列表信息
@@ -291,9 +293,24 @@ namespace HOZProject
             }
             else
             {
-                m_MeasureFile.Save();
-                //将初始化中的参数,配置到测量参数中
-                m_MeasureFile.MParam = uControl_Init.GetMeasureParamInfo();
+                //保存测量文件
+                if (m_MeasureFile.Save())
+                {
+                    //获取测量文件所在路径
+                    string savePath = m_MeasureFile.FilePath;
+                    //数据库名称
+                    string dbFileName = "MeasureFile.db";
+                    //要复制的文件路径
+                    string pLocalFilePath = Application.StartupPath +"\\"+dbFileName;
+                    string pSaveFilePath = savePath + dbFileName;//指定存储的路径
+                    if (File.Exists(pLocalFilePath))//必须判断要复制的文件是否存在
+                    {
+                        //三个参数分别是源文件路径,存储路径,若存储路径有相同文件是否替换
+                        File.Copy(pLocalFilePath, pSaveFilePath, true);
+                    }
+                    //将初始化中的参数,配置到测量参数中
+                    m_MeasureFile.MParam = uControl_Init.GetMeasureParamInfo();
+                }
             }
         }
 

+ 1 - 4
HOZProject/MeasureMsgDispose/MeasureMsgManage.cs

@@ -40,10 +40,7 @@ namespace HOZProject
                     formHOZ.lblFlowContent.Text = semParaContent;
                     break;
                 default:
-                    ////设置图像
-                    //formHOZ.pbImage.Image = null;
-                    ////流程内容
-                    //formHOZ.lblFlowContent.Text = "1";
+                    
                     break;
 
             }

+ 1 - 0
HOZProject/UnitControl.csproj

@@ -155,6 +155,7 @@
     <EmbeddedResource Include="UserControls\UCTimeLine.resx">
       <DependentUpon>UCTimeLine.cs</DependentUpon>
     </EmbeddedResource>
+    <None Include="DataBase\MeasureFile.db" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>