liuyuqi-dellpc 11 months ago
parent
commit
b3d1390560
1 changed files with 4 additions and 1 deletions
  1. 4 1
      KeepScreenLight/MainForm.cs

+ 4 - 1
KeepScreenLight/MainForm.cs

@@ -21,14 +21,17 @@ namespace KeepScreenLight
 
         private void button1_Click(object sender, EventArgs e)
         {
-            if (flag)
+            if (!flag)
             {
                 // 让屏幕常亮
                 SystemSleep.PreventForCurrentThread();
+                button1.Text = "Stop";
+                
             }
             else
             {
                 SystemSleep.RestoreForCurrentThread();
+                button1.Text = "Start";
             }
         }
     }