private void DrawBorder(Graphics graphics)
{
// Create a pen for drawing
using (Pen borderPen = new Pen(SystemColors.ControlDarkDark))
{
// Always draw the border dashed
borderPen.DashStyle = DashStyle.Dash;
// Get the client rectangle
Rectangle clientRect = Control.ClientRectangle;
// Reduce by 1 in width and height
clientRect.Width--;
clientRect.Height--;
// Perform actual draw
graphics.DrawRectangle(borderPen, clientRect);
}
}