void pictureBoxEMS_Paint(object sender, PaintEventArgs e)
{
e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
string component = "EMS Component";
Font fontComp = new Font(FontFamily.GenericSansSerif, 12);
SizeF sizeComp = e.Graphics.MeasureString(component, fontComp);
PointF locationComp = new PointF();
locationComp.X = (pictureBoxEMS.Width - sizeComp.Width) / 2;
locationComp.Y = (pictureBoxEMS.Height - sizeComp.Height) / 10;
e.Graphics.DrawString(component, fontComp, Brushes.Black, locationComp);
string title = "EMS Periodic Tasks";
Font titleFont = new Font(this.Font, FontStyle.Bold);
SizeF titleSize = e.Graphics.MeasureString(title, titleFont);
PointF titleLocation = new PointF();
titleLocation.X = (pictureBoxEMS.Width / 4) - (titleSize.Width / 2);
titleLocation.Y = (pictureBoxEMS.Height / 2) - (titleSize.Height);
e.Graphics.DrawString(title, titleFont, Brushes.Black, titleLocation);
string pi = "Period (Π)";
SizeF piSize = e.Graphics.MeasureString(pi, Font);
PointF piLocation = new PointF();
piLocation.X = textBoxEmsPi.Location.X - piSize.Width - 8;
piLocation.Y = textBoxEmsPi.Location.Y + (piSize.Height / 4);
e.Graphics.DrawString(pi, Font, Brushes.Black, piLocation);
string theta = "Execution (Θ)";
SizeF thetaSize = e.Graphics.MeasureString(theta, Font);
PointF thetaLocation = new PointF();
thetaLocation.X = textBoxEmsTheta.Location.X - thetaSize.Width - 8;
thetaLocation.Y = textBoxEmsTheta.Location.Y + (thetaSize.Height / 4);
e.Graphics.DrawString(theta, Font, Brushes.Black, thetaLocation);
string sync = "Sync tasks";
SizeF sizeSync = e.Graphics.MeasureString(sync, titleFont);
PointF locationSync = new PointF();
locationSync.X = dataGridViewSync.Location.X + (dataGridViewSync.Size.Width - sizeSync.Width) / 2;
locationSync.Y = dataGridViewSync.Location.Y - (sizeSync.Height * (float)1.1);
e.Graphics.DrawString(sync, titleFont, Brushes.Black, locationSync);
}