private void mpanelXaxisPaint(object sender, PaintEventArgs e) { try { int temp = 0; //Consider the graphics object of the x axis panel. Graphics g = e.Graphics; pnlXAxis.BackColor = Color.FromName(XAxisBackColor.Name); //The smoothing mode is set to A