public void Paint(Graphics g )
{
Pen pen = new Pen(Color.Red, 2);
using( pen )
{
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
Rectangle r = new Rectangle(location.X, location.Y, width, height);
DrawRoundRect(g, Brushes.LightSlateGray, Pens.SlateGray, r.Left, r.Top, r.Width, r.Height, 10f);
if( selected )
{
r.Inflate(-2, -2);
DrawRoundRect( g, null, pen, r.Left, r.Top, r.Width, r.Height, 10f );
}
r.Inflate( -5, -5 );
g.DrawString( "AC_SIGNAL", titleFont, Brushes.Black, r.Left, r.Top );
g.DrawString("Freq: 300hz", detailFont, Brushes.Black, r.Left, r.Top+20 );
g.DrawString("Ampl: 1v", detailFont, Brushes.Black, r.Left, r.Top + 35);
g.DrawString("Phase: 0r", detailFont, Brushes.Black, r.Left, r.Top + 50);
pen.Dispose();
}
}