private void RenderBorder() { IntPtr hdc = NativeMethods.GetWindowDC(this.Handle); APIRect s = new APIRect(); NativeMethods.GetWindowRect(this.Handle, ref s); using (Graphics g = Graphics.FromHdc(hdc)) { DrawingTools.DrawBorder((BorderStyle2)(int)this.BorderStyle, this.BorderColor, g, new Rectangle(0, 0, s.Width, s.Height)); } NativeMethods.ReleaseDC(this.Handle, hdc); }
private void RenderBorder() { IntPtr hdc = NativeMethods.GetWindowDC(Handle); var s = new APIRect(); NativeMethods.GetWindowRect(Handle, ref s); using (Graphics g = Graphics.FromHdc(hdc)) { DrawingTools.DrawBorder((BorderStyle2) (int) BorderStyle, BorderColor, g, new Rectangle(0, 0, s.Width, s.Height)); } NativeMethods.ReleaseDC(Handle, hdc); }