zhouxianguang 6 gadi atpakaļ
vecāks
revīzija
6c92182054
2 mainītis faili ar 11 papildinājumiem un 5 dzēšanām
  1. 3 3
      WinBox/MainForm.Designer.cs
  2. 8 2
      WinBox/MainForm.cs

+ 3 - 3
WinBox/MainForm.Designer.cs

@@ -38,15 +38,15 @@
             this.ClientSize = new System.Drawing.Size(1796, 1054);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
+            this.Margin = new System.Windows.Forms.Padding(6);
             this.Name = "MainForm";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
             this.Text = "领教云课堂";
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+            this.Activated += new System.EventHandler(this.Form1_Activated);
             this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.MainForm_FormClosed);
             this.Load += new System.EventHandler(this.Form1_Load);
-            this.Activated += new System.EventHandler(this.Form1_Activated);
-            
+            this.Shown += new System.EventHandler(this.MainForm_Shown);
             this.ResumeLayout(false);
 
         }

+ 8 - 2
WinBox/MainForm.cs

@@ -44,8 +44,7 @@ namespace WinBox
 
             RunBat("C:\\Lingjiao\\winBoxNode\\start.bat");
 
-            //检测端口
-            detectionPort();
+          
         }
 
         private void detectionPort()
@@ -110,6 +109,7 @@ namespace WinBox
             pro.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
             pro.Start();
             pro.Close();
+
         }
 
         private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
@@ -195,5 +195,11 @@ namespace WinBox
           
             //MainForm.Hide();
         }
+
+        private void MainForm_Shown(object sender, EventArgs e)
+        {
+            //检测端口
+            detectionPort();
+        }
     }
 }