grisage sur le les controls
authorsarias
Wed, 23 Sep 2009 17:11:43 +0200
changeset 91 0f29e2660bb7
parent 90 64d5eca7f5d6
child 92 3a0b48be34bd
child 95 07972aa3f2e0
grisage sur le les controls
src/FingersDance/MainSurfaceWindow.xaml.cs
--- a/src/FingersDance/MainSurfaceWindow.xaml.cs	Wed Sep 23 16:27:43 2009 +0200
+++ b/src/FingersDance/MainSurfaceWindow.xaml.cs	Wed Sep 23 17:11:43 2009 +0200
@@ -188,28 +188,61 @@
                 Grid2.Width = 1024 - e.GetPosition(mainSurfaceWindow).X;
                 Grid2.Height = e.GetPosition(mainSurfaceWindow).Y;
 
-                if (Grid1.Width < (1024 / 4) || Grid2.Height < (1024 / 4))
+                //GRISAGE
+                //Grid1
+                if (Grid1.Width < (1024 / 4) || Grid2.Height < (768 / 4))
                 {
-                    Grid1.Visibility = Visibility.Hidden;
+                    try
+                    {Grid1.Children[1].Visibility = Visibility.Hidden;}
+                    catch (Exception) { }
                 }
-                else { Grid1.Visibility = Visibility.Visible; }
-                if (Grid2.Width < (1024 / 4) || Grid2.Height < (1024 / 4))
+                else
+                {
+                    try
+                    { Grid1.Children[1].Visibility = Visibility.Visible; }
+                    catch (Exception) { }
+                }
+                //Grid2
+                if (Grid2.Width < (1024 / 4) || Grid2.Height < (768 / 4))
                 {
-                    Grid2.Visibility = Visibility.Hidden;
+                    try
+                    { Grid2.Children[1].Visibility = Visibility.Hidden; }
+                    catch (Exception) { }
+                }
+                else
+                {
+                    try
+                    { Grid2.Children[1].Visibility = Visibility.Visible; }
+                    catch (Exception) { }
                 }
-                else { Grid2.Visibility = Visibility.Visible; }
-                if (Grid3.Width < (1024 / 4) || Grid3.Height < (1024 / 4))
+                //Grid3
+                if (Grid3.Width < (1024 / 4) || Grid3.Height < (768 / 4))
                 {
-                    Grid3.Visibility = Visibility.Hidden;
+                    try
+                    { Grid3.Children[1].Visibility = Visibility.Hidden; }
+                    catch (Exception) { }
+                }
+                else
+                {
+                    try
+                    { Grid3.Children[1].Visibility = Visibility.Visible; }
+                    catch (Exception) { }
                 }
-                else { Grid3.Visibility = Visibility.Visible; }
-                if (Grid4.Width < (1024 / 4) || Grid4.Height < (1024 / 4))
+                //Grid4
+                if (Grid4.Width < (1024 / 4) || Grid4.Height < (768 / 4))
                 {
-                    Grid4.Visibility = Visibility.Hidden;
+                    try
+                    { Grid4.Children[1].Visibility = Visibility.Hidden; }
+                    catch (Exception) { }
                 }
-                else { Grid4.Visibility = Visibility.Visible; }
+                else
+                {
+                    try
+                    { Grid4.Children[1].Visibility = Visibility.Visible; }
+                    catch (Exception) { }
+                }
             }
-            catch (Exception ex) { }
+            catch (Exception) { }
         }
 
         private void UserControlPivot_EH_SurfaceButtonPlayer1_ContactDown(object sender, EventArgs e)
@@ -242,10 +275,10 @@
         {
             if (!isCreatedP2)
             {
-                UserControlUserPanel UserPanel2 = new UserControlUserPanel();
+               /* UserControlUserPanel UserPanel2 = new UserControlUserPanel();
                 UserPanel2.Name = "UserPanel2";
                 Grid2.Children.Add(UserPanel2);
-                isCreatedP2 = true;
+                isCreatedP2 = true;*/
 
                 //1-Creation du control Screen
                 UserControlScreen Screen2 = new UserControlScreen();