/[NexusPowerControl]/trunk/NexusPowerControl/MainUI.cs
ViewVC logotype

Diff of /trunk/NexusPowerControl/MainUI.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/NexusPowerControl/MainUI.cs	2011/10/22 23:37:10	14
+++ trunk/NexusPowerControl/MainUI.cs	2011/10/23 00:27:29	15
@@ -11,6 +11,7 @@
 {
     public partial class MainUI : Form
     {
+        MouseTrapper mouse_trapper = new MouseTrapper();
         public MainUI()
         {
             InitializeComponent();
@@ -36,7 +37,15 @@
             btnSleep.OnClickEvent += new EventHandler(btnSleep_Click);
             btnClose.OnClickEvent += new EventHandler(btnClose_Click);
         }
+        private void MainUI_Shown(object sender, EventArgs e)
+        {
+            mouse_trapper.TrapMouse(this);
+        }
 
+        private void MainUI_FormClosed(object sender, FormClosedEventArgs e)
+        {
+            mouse_trapper.ReleaseMouse(this);
+        }
         private void btnShutdown_Click(object sender, EventArgs e)
         {
             // shutdown the computer
@@ -67,8 +76,5 @@
             // close this dialog
             this.Close();
         }
-
-
-    
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22