예제 #1
0
                public override AccessibleObject HitTest(int x, int y)
                {
                    System.Drawing.Design.NativeMethods.POINT pt = new System.Drawing.Design.NativeMethods.POINT(x, y);
                    System.Drawing.Design.UnsafeNativeMethods.ScreenToClient(new HandleRef(this.ColorPalette, this.ColorPalette.Handle), pt);
                    int cellFromLocationMouse = System.Drawing.Design.ColorEditor.ColorPalette.GetCellFromLocationMouse(pt.x, pt.y);

                    if (cellFromLocationMouse != -1)
                    {
                        return(this.GetChild(cellFromLocationMouse));
                    }
                    return(base.HitTest(x, y));
                }
 public static extern int ScreenToClient(HandleRef hWnd, [In, Out] System.Drawing.Design.NativeMethods.POINT pt);
 public override AccessibleObject HitTest(int x, int y)
 {
     System.Drawing.Design.NativeMethods.POINT pt = new System.Drawing.Design.NativeMethods.POINT(x, y);
     System.Drawing.Design.UnsafeNativeMethods.ScreenToClient(new HandleRef(this.ColorPalette, this.ColorPalette.Handle), pt);
     int cellFromLocationMouse = System.Drawing.Design.ColorEditor.ColorPalette.GetCellFromLocationMouse(pt.x, pt.y);
     if (cellFromLocationMouse != -1)
     {
         return this.GetChild(cellFromLocationMouse);
     }
     return base.HitTest(x, y);
 }