zhouxianguang 6 年 前
コミット
6576b4ed21

+ 1 - 1
WinBox/CloseForm.Designer.cs

@@ -74,7 +74,7 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoSize = true;
-            this.BackgroundImage = global::WinBox.Properties.Resources.quitApp1;
+            this.BackgroundImage = global::WinBox.Properties.Resources.quitApp_new;
             this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
             this.ClientSize = new System.Drawing.Size(2078, 1058);
             this.Controls.Add(this.button2);

+ 9 - 19
WinBox/CloseForm.cs

@@ -28,34 +28,24 @@ namespace WinBox
 
         private void CloseForm_Load(object sender, EventArgs e)
         {
-            Rectangle rect = Screen.GetWorkingArea(this);
-            this.Height = rect.Height;
-            this.Width = rect.Width;
-            this.Location = new Point(0, 0);
-            //this.Owner.Hide();
         }
 
         private void button1_Click(object sender, EventArgs e)
         {
+            MainForm mainForm = new MainForm(this);
             this.Hide();
-            this.mainForm.ShowDialog();
+            mainForm.ShowDialog();
         }
 
         private void button2_Click(object sender, EventArgs e)
         {
-            MessageBoxButtons messButton = MessageBoxButtons.OKCancel;
-            DialogResult dr = MessageBox.Show("如果有下载课程操作会被终止,确认要退出吗", "退出",messButton);
-
-            if (dr == DialogResult.OK)//如果点击“确定”按钮
+            this.Close();
+            try
+            {
+                RunBat("C:\\Lingjiao\\winBoxNode\\stop.bat");
+            }
+            catch (Exception ex)
             {
-                this.Close();
-                try
-                {
-                    RunBat("C:\\Lingjiao\\winBoxNode\\stop.bat");
-                }
-                catch (Exception ex)
-                {
-                }
             }
         }
 
@@ -82,7 +72,7 @@ namespace WinBox
                 {
                     RunBat("C:\\Lingjiao\\winBoxNode\\stop.bat");
                 }
-                catch (Exception ex)
+              catch (Exception ex)
                 {
                 }
         }

+ 7 - 4
WinBox/MainForm.cs

@@ -24,6 +24,11 @@ namespace WinBox
             InitializeComponent();
         }
 
+        public MainForm(CloseForm closeForm)
+        {
+            InitializeComponent();
+        }
+
         /// <summary>
         /// 窗体加载
         /// </summary>
@@ -151,11 +156,9 @@ namespace WinBox
 
         private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
         {
-            CloseForm f = new CloseForm(this);
+            CloseForm closeForm = new CloseForm(this);
             this.Hide();
-            f.ShowDialog();
-          
-            //MainForm.Hide();
+            closeForm.ShowDialog();
         }
 
         private void MainForm_Shown(object sender, EventArgs e)

+ 20 - 0
WinBox/Properties/Resources.Designer.cs

@@ -73,11 +73,31 @@ namespace WinBox.Properties {
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>
+        internal static System.Drawing.Bitmap quitApp_new {
+            get {
+                object obj = ResourceManager.GetObject("quitApp_new", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
         internal static System.Drawing.Bitmap quitApp1 {
             get {
                 object obj = ResourceManager.GetObject("quitApp1", resourceCulture);
                 return ((System.Drawing.Bitmap)(obj));
             }
         }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap quitApp2 {
+            get {
+                object obj = ResourceManager.GetObject("quitApp2", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
     }
 }

+ 6 - 0
WinBox/Properties/Resources.resx

@@ -118,10 +118,16 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="quitApp2" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\quitApp2.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
   <data name="quitApp" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Resources\quitApp.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
   <data name="quitApp1" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Resources\quitApp1.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
+  <data name="quitApp_new" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\quitApp_new.jpg;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
 </root>

BIN
WinBox/Resources/quitApp2.jpg


BIN
WinBox/Resources/quitApp_new.jpg


+ 2 - 0
WinBox/WinBox.csproj

@@ -148,6 +148,8 @@
     <Content Include="img\quitApp.jpg" />
     <None Include="Resources\quitApp.jpg" />
     <None Include="Resources\quitApp1.jpg" />
+    <None Include="Resources\quitApp2.jpg" />
+    <None Include="Resources\quitApp_new.jpg" />
     <Content Include="shuangshi.ico" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />