Source/NFX.WinForms/Utils.cs
/// <summary>
/// Draws a rectangle that looks like underline which looks similar to VS or MS Word
/// </summary>
Draws a rectangle that looks like underline which looks similar to VS or MS Word
Draws a rectangle that looks like underline which looks similar to VS or MS Word
public static void DrawUnderlineRectangle(Graphics gr, Rectangle rect, Color color)
    {
      using (Pen pen = new Pen(color, 2f))
      {
        pen.DashStyle = DashStyle.Dot;
        gr.DrawLine(pen, rect.Left, rect.Top, rect.Right, rect.Top);
        gr.DrawLine(pen, rect.Left+2, rect.Top+1, rect.Right-2, rect.Top+1);
        gr.DrawLine(pen, rect.Left, rect.Bottom, rect.Right, rect.Bottom);
        gr.DrawLine(pen, rect.Left + 2, rect.Bottom - 1, rect.Right - 2, rect.Bottom - 1);
        gr.DrawLine(pen, rect.Left, rect.Top, rect.Left, rect.Bottom-1);
        gr.DrawLine(pen, rect.Left + 1, rect.Top + 2, rect.Left + 1, rect.Bottom -1);
        gr.DrawLine(pen, rect.Right, rect.Top, rect.Right, rect.Bottom - 1);
        gr.DrawLine(pen, rect.Right - 1, rect.Top + 2, rect.Right - 1, rect.Bottom - 1);
      }
    }
public static void DrawUnderlineRectangle ( Graphics gr , Rectangle rect , Color color ) { using ( Pen pen = new Pen ( color , 2f ) ) { pen . DashStyle = DashStyle . Dot ; gr . DrawLine ( pen , rect . Left , rect . Top , rect . Right , rect . Top ) ; gr . DrawLine ( pen , rect . Left + 2 , rect . Top + 1 , rect . Right - 2 , rect . Top + 1 ) ; gr . DrawLine ( pen , rect . Left , rect . Bottom , rect . Right , rect . Bottom ) ; gr . DrawLine ( pen , rect . Left + 2 , rect . Bottom - 1 , rect . Right - 2 , rect . Bottom - 1 ) ; gr . DrawLine ( pen , rect . Left , rect . Top , rect . Left , rect . Bottom - 1 ) ; gr . DrawLine ( pen , rect . Left + 1 , rect . Top + 2 , rect . Left + 1 , rect . Bottom - 1 ) ; gr . DrawLine ( pen , rect . Right , rect . Top , rect . Right , rect . Bottom - 1 ) ; gr . DrawLine ( pen , rect . Right - 1 , rect . Top + 2 , rect . Right - 1 , rect . Bottom - 1 ) ; } }
Draws a rectangle that looks like underline which looks similar to VS or MS Word
Draws a rectangle that looks like underline which looks similar to VS or MS Word
//top //bottom //left //right
gr
Graphics
rect
Rectangle
color
Color