Browse Source

更改了程序不可以双开,主界面开户后在中间显示不让其最大化,窗体可以拖动变化其大小。

@wang_qi0307 4 years ago
parent
commit
7bdae5d478

+ 1 - 1
HOZProject/App.config

@@ -5,7 +5,7 @@
     </startup>
     </startup>
     <appSettings>
     <appSettings>
       <!--厂商_数据源-->
       <!--厂商_数据源-->
-      <add key="Firm" value="厂商A,厂商B,厂商C,厂商D"/>
+      <add key="Firm" value="N-BOG,LG,SDC"/>
       <!--样品类型_数据源-->
       <!--样品类型_数据源-->
       <add key="Sample_Type" value="0,1,2"/>
       <add key="Sample_Type" value="0,1,2"/>
       <!--拍照的工作电压_数据源-->
       <!--拍照的工作电压_数据源-->

+ 29 - 29
HOZProject/FormHOZMain.Designer.cs

@@ -88,7 +88,7 @@
             this.plMain.Controls.Add(this.plLeft);
             this.plMain.Controls.Add(this.plLeft);
             this.plMain.Controls.Add(this.plTop);
             this.plMain.Controls.Add(this.plTop);
             this.plMain.Location = new System.Drawing.Point(16, 15);
             this.plMain.Location = new System.Drawing.Point(16, 15);
-            this.plMain.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plMain.Margin = new System.Windows.Forms.Padding(4);
             this.plMain.Name = "plMain";
             this.plMain.Name = "plMain";
             this.plMain.Size = new System.Drawing.Size(1333, 895);
             this.plMain.Size = new System.Drawing.Size(1333, 895);
             this.plMain.TabIndex = 1;
             this.plMain.TabIndex = 1;
@@ -105,7 +105,7 @@
             this.plFill.Controls.Add(this.pbImage);
             this.plFill.Controls.Add(this.pbImage);
             this.plFill.Controls.Add(this.plSEM);
             this.plFill.Controls.Add(this.plSEM);
             this.plFill.Location = new System.Drawing.Point(141, 108);
             this.plFill.Location = new System.Drawing.Point(141, 108);
-            this.plFill.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plFill.Margin = new System.Windows.Forms.Padding(4);
             this.plFill.Name = "plFill";
             this.plFill.Name = "plFill";
             this.plFill.Size = new System.Drawing.Size(1192, 788);
             this.plFill.Size = new System.Drawing.Size(1192, 788);
             this.plFill.TabIndex = 5;
             this.plFill.TabIndex = 5;
@@ -119,9 +119,9 @@
             this.groupBox1.Controls.Add(this.textBox2);
             this.groupBox1.Controls.Add(this.textBox2);
             this.groupBox1.ForeColor = System.Drawing.Color.White;
             this.groupBox1.ForeColor = System.Drawing.Color.White;
             this.groupBox1.Location = new System.Drawing.Point(925, 2);
             this.groupBox1.Location = new System.Drawing.Point(925, 2);
-            this.groupBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
             this.groupBox1.Name = "groupBox1";
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Padding = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
             this.groupBox1.Size = new System.Drawing.Size(267, 125);
             this.groupBox1.Size = new System.Drawing.Size(267, 125);
             this.groupBox1.TabIndex = 26;
             this.groupBox1.TabIndex = 26;
             this.groupBox1.TabStop = false;
             this.groupBox1.TabStop = false;
@@ -131,7 +131,7 @@
             // textBox1
             // textBox1
             // 
             // 
             this.textBox1.Location = new System.Drawing.Point(8, 25);
             this.textBox1.Location = new System.Drawing.Point(8, 25);
-            this.textBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.textBox1.Margin = new System.Windows.Forms.Padding(4);
             this.textBox1.Name = "textBox1";
             this.textBox1.Name = "textBox1";
             this.textBox1.Size = new System.Drawing.Size(132, 25);
             this.textBox1.Size = new System.Drawing.Size(132, 25);
             this.textBox1.TabIndex = 21;
             this.textBox1.TabIndex = 21;
@@ -141,7 +141,7 @@
             // 
             // 
             this.button1.ForeColor = System.Drawing.Color.Black;
             this.button1.ForeColor = System.Drawing.Color.Black;
             this.button1.Location = new System.Drawing.Point(159, 25);
             this.button1.Location = new System.Drawing.Point(159, 25);
-            this.button1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.button1.Margin = new System.Windows.Forms.Padding(4);
             this.button1.Name = "button1";
             this.button1.Name = "button1";
             this.button1.Size = new System.Drawing.Size(100, 92);
             this.button1.Size = new System.Drawing.Size(100, 92);
             this.button1.TabIndex = 24;
             this.button1.TabIndex = 24;
@@ -156,7 +156,7 @@
             "True",
             "True",
             "False"});
             "False"});
             this.comboBox1.Location = new System.Drawing.Point(8, 92);
             this.comboBox1.Location = new System.Drawing.Point(8, 92);
-            this.comboBox1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.comboBox1.Margin = new System.Windows.Forms.Padding(4);
             this.comboBox1.Name = "comboBox1";
             this.comboBox1.Name = "comboBox1";
             this.comboBox1.Size = new System.Drawing.Size(132, 23);
             this.comboBox1.Size = new System.Drawing.Size(132, 23);
             this.comboBox1.TabIndex = 25;
             this.comboBox1.TabIndex = 25;
@@ -164,7 +164,7 @@
             // textBox2
             // textBox2
             // 
             // 
             this.textBox2.Location = new System.Drawing.Point(8, 59);
             this.textBox2.Location = new System.Drawing.Point(8, 59);
-            this.textBox2.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.textBox2.Margin = new System.Windows.Forms.Padding(4);
             this.textBox2.Name = "textBox2";
             this.textBox2.Name = "textBox2";
             this.textBox2.Size = new System.Drawing.Size(132, 25);
             this.textBox2.Size = new System.Drawing.Size(132, 25);
             this.textBox2.TabIndex = 22;
             this.textBox2.TabIndex = 22;
@@ -174,7 +174,7 @@
             // 
             // 
             this.plPrarInfo.BackColor = System.Drawing.Color.White;
             this.plPrarInfo.BackColor = System.Drawing.Color.White;
             this.plPrarInfo.Location = new System.Drawing.Point(0, 0);
             this.plPrarInfo.Location = new System.Drawing.Point(0, 0);
-            this.plPrarInfo.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plPrarInfo.Margin = new System.Windows.Forms.Padding(4);
             this.plPrarInfo.Name = "plPrarInfo";
             this.plPrarInfo.Name = "plPrarInfo";
             this.plPrarInfo.Size = new System.Drawing.Size(291, 125);
             this.plPrarInfo.Size = new System.Drawing.Size(291, 125);
             this.plPrarInfo.TabIndex = 2;
             this.plPrarInfo.TabIndex = 2;
@@ -196,7 +196,7 @@
             // 
             // 
             this.pbImage.Dock = System.Windows.Forms.DockStyle.Fill;
             this.pbImage.Dock = System.Windows.Forms.DockStyle.Fill;
             this.pbImage.Location = new System.Drawing.Point(0, 0);
             this.pbImage.Location = new System.Drawing.Point(0, 0);
-            this.pbImage.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbImage.Margin = new System.Windows.Forms.Padding(4);
             this.pbImage.Name = "pbImage";
             this.pbImage.Name = "pbImage";
             this.pbImage.Size = new System.Drawing.Size(1192, 718);
             this.pbImage.Size = new System.Drawing.Size(1192, 718);
             this.pbImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
             this.pbImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
@@ -210,7 +210,7 @@
             this.plSEM.Controls.Add(this.lblFlowContent);
             this.plSEM.Controls.Add(this.lblFlowContent);
             this.plSEM.Dock = System.Windows.Forms.DockStyle.Bottom;
             this.plSEM.Dock = System.Windows.Forms.DockStyle.Bottom;
             this.plSEM.Location = new System.Drawing.Point(0, 718);
             this.plSEM.Location = new System.Drawing.Point(0, 718);
-            this.plSEM.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plSEM.Margin = new System.Windows.Forms.Padding(4);
             this.plSEM.Name = "plSEM";
             this.plSEM.Name = "plSEM";
             this.plSEM.Size = new System.Drawing.Size(1192, 70);
             this.plSEM.Size = new System.Drawing.Size(1192, 70);
             this.plSEM.TabIndex = 19;
             this.plSEM.TabIndex = 19;
@@ -246,7 +246,7 @@
             this.plLeft.Controls.Add(this.plLeftContent);
             this.plLeft.Controls.Add(this.plLeftContent);
             this.plLeft.Dock = System.Windows.Forms.DockStyle.Left;
             this.plLeft.Dock = System.Windows.Forms.DockStyle.Left;
             this.plLeft.Location = new System.Drawing.Point(0, 100);
             this.plLeft.Location = new System.Drawing.Point(0, 100);
-            this.plLeft.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plLeft.Margin = new System.Windows.Forms.Padding(4);
             this.plLeft.Name = "plLeft";
             this.plLeft.Name = "plLeft";
             this.plLeft.Size = new System.Drawing.Size(133, 795);
             this.plLeft.Size = new System.Drawing.Size(133, 795);
             this.plLeft.TabIndex = 4;
             this.plLeft.TabIndex = 4;
@@ -257,7 +257,7 @@
             this.label1.BackColor = System.Drawing.Color.Transparent;
             this.label1.BackColor = System.Drawing.Color.Transparent;
             this.label1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.ForeColor = System.Drawing.Color.Gainsboro;
             this.label1.ForeColor = System.Drawing.Color.Gainsboro;
-            this.label1.Location = new System.Drawing.Point(29, 4);
+            this.label1.Location = new System.Drawing.Point(24, 4);
             this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(87, 15);
             this.label1.Size = new System.Drawing.Size(87, 15);
@@ -271,7 +271,7 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             | System.Windows.Forms.AnchorStyles.Right)));
             this.plLeftContent.AutoScroll = true;
             this.plLeftContent.AutoScroll = true;
             this.plLeftContent.Location = new System.Drawing.Point(7, 24);
             this.plLeftContent.Location = new System.Drawing.Point(7, 24);
-            this.plLeftContent.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plLeftContent.Margin = new System.Windows.Forms.Padding(4);
             this.plLeftContent.Name = "plLeftContent";
             this.plLeftContent.Name = "plLeftContent";
             this.plLeftContent.Size = new System.Drawing.Size(120, 771);
             this.plLeftContent.Size = new System.Drawing.Size(120, 771);
             this.plLeftContent.TabIndex = 0;
             this.plLeftContent.TabIndex = 0;
@@ -293,7 +293,7 @@
             this.plTop.Controls.Add(this.pbNew);
             this.plTop.Controls.Add(this.pbNew);
             this.plTop.Dock = System.Windows.Forms.DockStyle.Top;
             this.plTop.Dock = System.Windows.Forms.DockStyle.Top;
             this.plTop.Location = new System.Drawing.Point(0, 0);
             this.plTop.Location = new System.Drawing.Point(0, 0);
-            this.plTop.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.plTop.Margin = new System.Windows.Forms.Padding(4);
             this.plTop.Name = "plTop";
             this.plTop.Name = "plTop";
             this.plTop.Size = new System.Drawing.Size(1333, 100);
             this.plTop.Size = new System.Drawing.Size(1333, 100);
             this.plTop.TabIndex = 3;
             this.plTop.TabIndex = 3;
@@ -305,7 +305,7 @@
             this.pbStop.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbStop.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbStop.Enabled = false;
             this.pbStop.Enabled = false;
             this.pbStop.Location = new System.Drawing.Point(596, 5);
             this.pbStop.Location = new System.Drawing.Point(596, 5);
-            this.pbStop.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbStop.Margin = new System.Windows.Forms.Padding(4);
             this.pbStop.Name = "pbStop";
             this.pbStop.Name = "pbStop";
             this.pbStop.Size = new System.Drawing.Size(91, 89);
             this.pbStop.Size = new System.Drawing.Size(91, 89);
             this.pbStop.TabIndex = 8;
             this.pbStop.TabIndex = 8;
@@ -320,7 +320,7 @@
             this.pbPause.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbPause.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbPause.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbPause.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbPause.Location = new System.Drawing.Point(695, 5);
             this.pbPause.Location = new System.Drawing.Point(695, 5);
-            this.pbPause.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbPause.Margin = new System.Windows.Forms.Padding(4);
             this.pbPause.Name = "pbPause";
             this.pbPause.Name = "pbPause";
             this.pbPause.Size = new System.Drawing.Size(91, 89);
             this.pbPause.Size = new System.Drawing.Size(91, 89);
             this.pbPause.TabIndex = 8;
             this.pbPause.TabIndex = 8;
@@ -333,7 +333,7 @@
             this.pbStart.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbStart.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbStart.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbStart.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbStart.Location = new System.Drawing.Point(497, 5);
             this.pbStart.Location = new System.Drawing.Point(497, 5);
-            this.pbStart.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbStart.Margin = new System.Windows.Forms.Padding(4);
             this.pbStart.Name = "pbStart";
             this.pbStart.Name = "pbStart";
             this.pbStart.Size = new System.Drawing.Size(91, 89);
             this.pbStart.Size = new System.Drawing.Size(91, 89);
             this.pbStart.TabIndex = 8;
             this.pbStart.TabIndex = 8;
@@ -349,7 +349,7 @@
             this.pbMax.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbMax.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbMax.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbMax.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbMax.Location = new System.Drawing.Point(1247, 0);
             this.pbMax.Location = new System.Drawing.Point(1247, 0);
-            this.pbMax.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbMax.Margin = new System.Windows.Forms.Padding(4);
             this.pbMax.Name = "pbMax";
             this.pbMax.Name = "pbMax";
             this.pbMax.Size = new System.Drawing.Size(37, 39);
             this.pbMax.Size = new System.Drawing.Size(37, 39);
             this.pbMax.TabIndex = 7;
             this.pbMax.TabIndex = 7;
@@ -365,7 +365,7 @@
             this.pbMin.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbMin.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbMin.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbMin.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbMin.Location = new System.Drawing.Point(1201, 0);
             this.pbMin.Location = new System.Drawing.Point(1201, 0);
-            this.pbMin.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbMin.Margin = new System.Windows.Forms.Padding(4);
             this.pbMin.Name = "pbMin";
             this.pbMin.Name = "pbMin";
             this.pbMin.Size = new System.Drawing.Size(37, 39);
             this.pbMin.Size = new System.Drawing.Size(37, 39);
             this.pbMin.TabIndex = 7;
             this.pbMin.TabIndex = 7;
@@ -381,7 +381,7 @@
             this.pbClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbClose.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbClose.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbClose.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbClose.Location = new System.Drawing.Point(1292, 0);
             this.pbClose.Location = new System.Drawing.Point(1292, 0);
-            this.pbClose.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbClose.Margin = new System.Windows.Forms.Padding(4);
             this.pbClose.Name = "pbClose";
             this.pbClose.Name = "pbClose";
             this.pbClose.Size = new System.Drawing.Size(37, 39);
             this.pbClose.Size = new System.Drawing.Size(37, 39);
             this.pbClose.TabIndex = 7;
             this.pbClose.TabIndex = 7;
@@ -396,7 +396,7 @@
             this.pbImportTemplateFile.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbImportTemplateFile.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbImportTemplateFile.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbImportTemplateFile.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbImportTemplateFile.Location = new System.Drawing.Point(299, 5);
             this.pbImportTemplateFile.Location = new System.Drawing.Point(299, 5);
-            this.pbImportTemplateFile.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbImportTemplateFile.Margin = new System.Windows.Forms.Padding(4);
             this.pbImportTemplateFile.Name = "pbImportTemplateFile";
             this.pbImportTemplateFile.Name = "pbImportTemplateFile";
             this.pbImportTemplateFile.Size = new System.Drawing.Size(91, 89);
             this.pbImportTemplateFile.Size = new System.Drawing.Size(91, 89);
             this.pbImportTemplateFile.TabIndex = 6;
             this.pbImportTemplateFile.TabIndex = 6;
@@ -409,7 +409,7 @@
             this.pbLog.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbLog.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbLog.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbLog.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbLog.Location = new System.Drawing.Point(396, 5);
             this.pbLog.Location = new System.Drawing.Point(396, 5);
-            this.pbLog.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbLog.Margin = new System.Windows.Forms.Padding(4);
             this.pbLog.Name = "pbLog";
             this.pbLog.Name = "pbLog";
             this.pbLog.Size = new System.Drawing.Size(91, 89);
             this.pbLog.Size = new System.Drawing.Size(91, 89);
             this.pbLog.TabIndex = 6;
             this.pbLog.TabIndex = 6;
@@ -422,7 +422,7 @@
             this.pbInit.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbInit.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbInit.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbInit.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbInit.Location = new System.Drawing.Point(201, 5);
             this.pbInit.Location = new System.Drawing.Point(201, 5);
-            this.pbInit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbInit.Margin = new System.Windows.Forms.Padding(4);
             this.pbInit.Name = "pbInit";
             this.pbInit.Name = "pbInit";
             this.pbInit.Size = new System.Drawing.Size(91, 89);
             this.pbInit.Size = new System.Drawing.Size(91, 89);
             this.pbInit.TabIndex = 5;
             this.pbInit.TabIndex = 5;
@@ -435,7 +435,7 @@
             this.pbSave.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbSave.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbSave.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbSave.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbSave.Location = new System.Drawing.Point(104, 5);
             this.pbSave.Location = new System.Drawing.Point(104, 5);
-            this.pbSave.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbSave.Margin = new System.Windows.Forms.Padding(4);
             this.pbSave.Name = "pbSave";
             this.pbSave.Name = "pbSave";
             this.pbSave.Size = new System.Drawing.Size(91, 89);
             this.pbSave.Size = new System.Drawing.Size(91, 89);
             this.pbSave.TabIndex = 4;
             this.pbSave.TabIndex = 4;
@@ -448,7 +448,7 @@
             this.pbOpen.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbOpen.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbOpen.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbOpen.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbOpen.Location = new System.Drawing.Point(7, 5);
             this.pbOpen.Location = new System.Drawing.Point(7, 5);
-            this.pbOpen.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbOpen.Margin = new System.Windows.Forms.Padding(4);
             this.pbOpen.Name = "pbOpen";
             this.pbOpen.Name = "pbOpen";
             this.pbOpen.Size = new System.Drawing.Size(91, 89);
             this.pbOpen.Size = new System.Drawing.Size(91, 89);
             this.pbOpen.TabIndex = 3;
             this.pbOpen.TabIndex = 3;
@@ -461,7 +461,7 @@
             this.pbNew.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbNew.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
             this.pbNew.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbNew.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pbNew.Location = new System.Drawing.Point(7, 5);
             this.pbNew.Location = new System.Drawing.Point(7, 5);
-            this.pbNew.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pbNew.Margin = new System.Windows.Forms.Padding(4);
             this.pbNew.Name = "pbNew";
             this.pbNew.Name = "pbNew";
             this.pbNew.Size = new System.Drawing.Size(91, 89);
             this.pbNew.Size = new System.Drawing.Size(91, 89);
             this.pbNew.TabIndex = 3;
             this.pbNew.TabIndex = 3;
@@ -478,12 +478,12 @@
             this.ControlBox = false;
             this.ControlBox = false;
             this.Controls.Add(this.plMain);
             this.Controls.Add(this.plMain);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "FormHOZMain";
             this.Name = "FormHOZMain";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "FormHOZMain";
             this.Text = "FormHOZMain";
-            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
             this.Load += new System.EventHandler(this.FormHOZMain_Load);
             this.Load += new System.EventHandler(this.FormHOZMain_Load);
+            this.Resize += new System.EventHandler(this.FormHOZMain_Resize);
             this.plMain.ResumeLayout(false);
             this.plMain.ResumeLayout(false);
             this.plFill.ResumeLayout(false);
             this.plFill.ResumeLayout(false);
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.ResumeLayout(false);

+ 68 - 3
HOZProject/FormHOZMain.cs

@@ -19,6 +19,54 @@ namespace HOZProject
 {
 {
     public partial class FormHOZMain : Form
     public partial class FormHOZMain : Form
     {
     {
+        #region 控制窗体可以调整大小用
+        const int HTLEFT = 10;
+        const int HTRIGHT = 11;
+        const int HTTOP = 12;
+        const int HTTOPLEFT = 13;
+        const int HTTOPRIGHT = 14;
+        const int HTBOTTOM = 15;
+        const int HTBOTTOMLEFT = 0x10;
+        const int HTBOTTOMRIGHT = 17;
+        protected override void WndProc(ref Message m)
+        {
+            switch (m.Msg)
+            {
+                case 0x0084:
+                    base.WndProc(ref m);
+                    Point vPoint = new Point((int)m.LParam & 0xFFFF,
+                        (int)m.LParam >> 16 & 0xFFFF);
+                    vPoint = PointToClient(vPoint);
+                    if (vPoint.X <= 5)
+                        if (vPoint.Y <= 5)
+                            m.Result = (IntPtr)HTTOPLEFT;
+                        else if (vPoint.Y >= ClientSize.Height - 5)
+                            m.Result = (IntPtr)HTBOTTOMLEFT;
+                        else m.Result = (IntPtr)HTLEFT;
+                    else if (vPoint.X >= ClientSize.Width - 5)
+                        if (vPoint.Y <= 5)
+                            m.Result = (IntPtr)HTTOPRIGHT;
+                        else if (vPoint.Y >= ClientSize.Height - 5)
+                            m.Result = (IntPtr)HTBOTTOMRIGHT;
+                        else m.Result = (IntPtr)HTRIGHT;
+                    else if (vPoint.Y <= 5)
+                        m.Result = (IntPtr)HTTOP;
+                    else if (vPoint.Y >= ClientSize.Height - 5)
+                        m.Result = (IntPtr)HTBOTTOM;
+                    break;
+                case 0x0201://鼠标左键按下的消息 
+                    m.Msg = 0x00A1;//更改消息为非客户区按下鼠标 
+                    m.LParam = IntPtr.Zero;//默认值 
+                    m.WParam = new IntPtr(2);//鼠标放在标题栏内 
+                    base.WndProc(ref m);
+                    break;
+                default:
+                    base.WndProc(ref m);
+                    break;
+            }
+        }
+        #endregion
+
         #region 成员变量
         #region 成员变量
         public BackgroundWorker m_BackgroundWorker;// 申明后台对象
         public BackgroundWorker m_BackgroundWorker;// 申明后台对象
         /// <summary>
         /// <summary>
@@ -479,8 +527,18 @@ namespace HOZProject
             //判断保存的路径是否存在
             //判断保存的路径是否存在
             if (!Directory.Exists(m_TemplateFilePath))
             if (!Directory.Exists(m_TemplateFilePath))
             {
             {
-                //创建路径
-                Directory.CreateDirectory(m_TemplateFilePath);
+                ////创建路径
+                //Directory.CreateDirectory(m_TemplateFilePath);
+                FolderBrowserDialog dialog = new FolderBrowserDialog();
+                dialog.Description = "请选择文件路径";
+                //dialog.RootFolder = Environment.SpecialFolder.Programs;
+                if (dialog.ShowDialog() == DialogResult.OK)
+                {
+                    m_TemplateFilePath = dialog.SelectedPath;
+                    config.AppSettings.Settings["TemplateFilePath"].Value = m_TemplateFilePath;
+                    config.Save(ConfigurationSaveMode.Modified);
+                    ConfigurationManager.RefreshSection("appSettings");//重新加载新的配置文件
+                }
             }
             }
             //打开默认路径
             //打开默认路径
             OpenFileDialog openFileDialog = new OpenFileDialog();
             OpenFileDialog openFileDialog = new OpenFileDialog();
@@ -813,6 +871,13 @@ namespace HOZProject
             }
             }
         }
         }
         #endregion
         #endregion
-        
+
+        private void FormHOZMain_Resize(object sender, EventArgs e)
+        {
+            plMain.Left = 12;
+            plMain.Top = 12;
+            plMain.Width = this.Width - 24;
+            plMain.Height = this.Height - 24;
+        }
     }
     }
 }
 }

+ 13 - 1
HOZProject/Program.cs

@@ -17,9 +17,21 @@ namespace HOZProject
             Application.EnableVisualStyles();
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
             Application.SetCompatibleTextRenderingDefault(false);
             //Application.Run(new FormUCMain());
             //Application.Run(new FormUCMain());
-            Application.Run(new FormHOZMain());
+            //Application.Run(new FormHOZMain());
             //Application.Run(new FormMeasureTest());
             //Application.Run(new FormMeasureTest());
             //Application.Run(new FormUnitControl());
             //Application.Run(new FormUnitControl());
+            bool createdNew;//返回是否赋予了使用线程的互斥体初始所属权 
+            System.Threading.Mutex instance = new System.Threading.Mutex(true, "MutexName", out createdNew); //同步基元变量 
+            if (createdNew) //赋予了线程初始所属权,也就是首次使用互斥体 
+            {
+                Application.Run(new FormHOZMain());
+                instance.ReleaseMutex();
+            }
+            else
+            {
+                MessageBox.Show("已经启动了一个程序,请先退出!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
+                Application.Exit();
+            }
         }
         }
     }
     }
 }
 }

+ 27 - 11
HOZProject/UserControls/UControl_ParaInfo.cs

@@ -160,27 +160,43 @@ namespace HOZProject
         {
         {
             int multiple = 1000;
             int multiple = 1000;
             //设置Position参数
             //设置Position参数
-            lblX.Text = (Position.X * multiple).ToString("f3");
-            lblY.Text = (Position.Y * multiple).ToString("f3");
-            lblZ.Text = (Position.Z * multiple).ToString("f3");
+            lblX.Text = (Position.X * multiple).ToString("f2");
+            lblY.Text = (Position.Y * multiple).ToString("f2");
+            lblZ.Text = (Position.Z * multiple).ToString("f2");
             lblR.Text = Position.R.ToString();
             lblR.Text = Position.R.ToString();
             lblT.Text = Position.T.ToString();
             lblT.Text = Position.T.ToString();
             lblM.Text = (Position.M * multiple).ToString();
             lblM.Text = (Position.M * multiple).ToString();
-            if(StartTime== "0001/1/1 0:00:00")
+            try
             {
             {
-                lblShowStartTime.Text = "";
+                DateTime dtst = Convert.ToDateTime(StartTime);
+                if (dtst.Year != System.DateTime.Now.Year)
+                {
+                    lblShowStartTime.Text = "";
+                }
+                else
+                {
+                    lblShowStartTime.Text = StartTime;
+                }
             }
             }
-            else
+            catch
             {
             {
-                lblShowStartTime.Text = StartTime;
+                lblShowStartTime.Text = "";
             }
             }
-            if (EndTime == "0001/1/1 0:00:00")
+            try
             {
             {
-                lblShowEndTime.Text = "";
+                DateTime dtet = Convert.ToDateTime(EndTime);
+                if (dtet.Year != System.DateTime.Now.Year)
+                {
+                    lblShowEndTime.Text = "";
+                }
+                else
+                {
+                    lblShowEndTime.Text = EndTime;
+                }
             }
             }
-            else
+            catch
             {
             {
-                lblShowEndTime.Text = EndTime;
+                lblShowEndTime.Text = "";
             }
             }
             
             
             //设置切孔状态
             //设置切孔状态