I am using C# to write data to a print page, and the data is outputting in the incorrect order. I need to change the order so that it will display as 1, 4, 2, 3 and not in 1, 2, 3, 4
This is my current syntax:
//Section 1
int iAreaStartLX = iLegendsBoxX + 8;
int iAreaStartLY = iLegendsBoxY + 8;
int iTextXPos = iAreaStartLX + 50;
int iTriStartLX = iAreaStartLX + 25;
Point[] AreaStartPts = new Point[3];
AreaStartPts[0] = new Point(iTriStartLX, iAreaStartLY);
AreaStartPts[1] = new Point(iTriStartLX + 20, iAreaStartLY);
AreaStartPts[2] = new Point(iTriStartLX + 10, iAreaStartLY + 18);
e.Graphics.FillPolygon(StartSahpeBrush, AreaStartPts);
e.Graphics.DrawPolygon(Pens.Red, AreaStartPts);
e.Graphics.DrawString("Data For Point 1", new Font("Times New Roman", 10), new SolidBrush(Color.Black), iTextXPos, 105);
//Section 2
int iLNStartLX = iAreaStartLX;
int iLNStartLY = iAreaStartLY + 25;
Point point1 = new Point(iLNStartLX, iLNStartLY + 10);
Point point2 = new Point(iLNStartLX + 45, iLNStartLY + 10);
e.Graphics.DrawLine(RedDashPen, point1, point2);
e.Graphics.DrawString("Data For Point 2", new Font("Times New Roman", 10), new SolidBrush(Color.Black), iTextXPos, 130);
//Section 3
int iLNEndLX = iAreaStartLX;
int iLNEndLY = iLNStartLY + 25;
point1 = new Point(iLNEndLX, iLNEndLY + 10);
point2 = new Point(iLNEndLX + 45, iLNEndLY + 10);
e.Graphics.DrawLine(RedPen, point1, point2);
e.Graphics.DrawString("Data For Point 3", new Font("Times New Roman", 10), new SolidBrush(Color.Black), iTextXPos, 155);
//Section 4
int iAreaEndLY = iLegendsBoxY + 85;
int iTextYPos = iAreaStartLX + 50;
int iTriEndLX = iAreaStartLX + 25;
AreaStartPts[0] = new Point(iTriEndLX, iAreaEndLY);
AreaStartPts[1] = new Point(iTriEndLX + 20, iAreaEndLY);
AreaStartPts[2] = new Point(iTriEndLX + 10, iAreaEndLY + 18);
e.Graphics.DrawPolygon(RedDottedPen, AreaStartPts);
e.Graphics.DrawString("Data For Point 4", new Font("Times New Roman", 10), new SolidBrush(Color.Black), iTextXPos, 180);
Now of course I did the obvious and copy/pasted //Section 4
directly under //Section 1
but the output was in the same order. What would be the proper way to change the order these .DrawString
display on the page?