# Region draw rounded rectangular area
Internal static graphicspath createroundedrectanglepath (rectangle rect, int cornerradius)
{
Graphicspath roundedrect = new graphicspath ();
Roundedrect. addarc (rect. X, rect. Y, cornerradius * 2, cornerradius * 2,180, 90 );
Roundedrect. addline (rect. x + cornerradius, rect. Y, rect. Right-cornerradius * 2, rect. y );
Roundedrect. addarc (rect. x + rect. Width-cornerradius * 2, rect. Y, cornerradius * 2, cornerradius * 2,270, 90 );
Roundedrect. addline (rect. Right, rect. Y + cornerradius * 2, rect. Right, rect. Y + rect. Height-cornerradius * 2 );
Roundedrect. addarc (rect. X + rect. width-cornerradius * 2, rect. Y + rect. height-cornerradius * 2, cornerradius * 2, cornerradius * 2, 0, 90 );
Roundedrect. addline (rect. Right-cornerradius * 2, rect. Bottom, rect. x + cornerradius * 2, rect. Bottom );
Roundedrect. addarc (rect. X, rect. Bottom-cornerradius * 2, cornerradius * 2, cornerradius * 2, 90, 90 );
Roundedrect. addline (rect. X, rect. Bottom-cornerradius * 2, rect. X, rect. Y + cornerradius * 2 );
Roundedrect. closefigure ();
Return roundedrect;
}
# Endregion