Exemple #1
0
            public HandleBackground(Form form, Margins m)
            {
                _margins = m;

                //Hook
                form.Paint += new PaintEventHandler(form_Paint);
            }
Exemple #2
0
 /// <summary>
 /// Adds a handler on the Form that enables the user to move the window around
 /// by clicking on a glass margin (or the title bar, as usual).
 /// </summary>
 /// <param name="form">The form that will be controlled.</param>
 /// <param name="margins">Margins of the glass sheet.</param>
 /// <remarks>
 /// Eventual UI elements on the glass sheet will prevent the handler from receiving events
 /// (except the ThemeText control, which manually redirects mouse events to the form).
 /// </remarks>
 public static void HandleFormMovementOnGlass(Form form, Margins margins)
 {
     HandleFormMovement tmpHandler = new HandleFormMovement(form, margins);
 }
Exemple #3
0
 /// <summary>
 /// Adds a handler on the Form that automatically paints the glass background black
 /// </summary>
 /// <param name="form">The form that will be controlled.</param>
 /// <param name="margins">Margins of the glass sheet.</param>
 public static void HandleBackgroundPainting(Form form, Margins margins)
 {
     HandleBackground tmpHandler = new HandleBackground(form, margins);
 }
Exemple #4
0
 public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref Margins pMarInset);
Exemple #5
0
 /// <summary>Extends the Aero "Glass Frame" into the client area. Background must be black.</summary>
 public static void EnableGlassFrame(IntPtr hWnd, Margins margins)
 {
     InternalGlassFrame(hWnd, margins);
 }
Exemple #6
0
 /// <summary>Extends the Aero "Glass Frame" into the client area. Background must be black.</summary>
 public static void EnableGlassFrame(Form window, Margins margins)
 {
     InternalGlassFrame(window.Handle, margins);
 }
Exemple #7
0
        private static void InternalGlassFrame(IntPtr hWnd, Margins margins) {
            if (!OsSupport.IsVistaOrBetter || !OsSupport.IsCompositionEnabled)
                return;

            if (NativeMethods.DwmExtendFrameIntoClientArea(hWnd, ref margins) != 0)
                throw new DwmCompositionException(String.Format(Resources.ExceptionMessages.NativeCallFailure, "DwmExtendFrameIntoClientArea"));
        }
Exemple #8
0
 /// <summary>Extends the Aero "Glass Frame" into the client area. Background must be black.</summary>
 public static void EnableGlassFrame(IntPtr hWnd, Margins margins) {
     InternalGlassFrame(hWnd, margins);
 }
Exemple #9
0
 /// <summary>Extends the Aero "Glass Frame" into the client area. Background must be black.</summary>
 public static void EnableGlassFrame(Form window, Margins margins) {
     InternalGlassFrame(window.Handle, margins);
 }
Exemple #10
0
 /// <summary>
 /// Adds a handler on the Form that enables the user to move the window around
 /// by clicking on a glass margin (or the title bar, as usual).
 /// </summary>
 /// <param name="form">The form that will be controlled.</param>
 /// <param name="margins">Margins of the glass sheet.</param>
 /// <remarks>
 /// Eventual UI elements on the glass sheet will prevent the handler from receiving events
 /// (except the ThemeText control, which manually redirects mouse events to the form).
 /// </remarks>
 public static void HandleFormMovementOnGlass(Form form, Margins margins)
 {
     HandleFormMovement tmpHandler = new HandleFormMovement(form, margins);
 }
Exemple #11
0
 /// <summary>
 /// Adds a handler on the Form that automatically paints the glass background black
 /// </summary>
 /// <param name="form">The form that will be controlled.</param>
 /// <param name="margins">Margins of the glass sheet.</param>
 public static void HandleBackgroundPainting(Form form, Margins margins)
 {
     HandleBackground tmpHandler = new HandleBackground(form, margins);
 }
Exemple #12
0
            public HandleFormMovement(Form form, Margins margins)
            {
                _margins = margins;

                //Register handlers
                form.MouseDown += new MouseEventHandler(form_MouseDown);
                form.MouseUp += new MouseEventHandler(form_MouseUp);
                form.MouseMove += new MouseEventHandler(form_MouseMove);
            }
Exemple #13
0
 public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref Margins pMarInset);