Beispiel #1
0
        /// <summary> implement ControlPaint.DrawFocusRectangle
        /// </summary>
        /// <param name="graphics"></param>
        /// <param name="rectangle"></param>
        internal static void DrawFocusRectangle(Graphics graphics, Rectangle rectangle)
        {
            IntPtr hdc = graphics.GetHdc();
            RECT   rc  = new RECT();

            rc.left   = rectangle.Left;
            rc.top    = rectangle.Top;
            rc.right  = rectangle.Right;
            rc.bottom = rectangle.Bottom;
            NativeWindowCommon.DrawFocusRect(hdc, ref rc);
            graphics.ReleaseHdc(hdc);
        }