Incorrect Co-Ordinates????

Nov 9 2003 6:58 PM
hey i am trying to draw lines on a panel based on the panel's co-ordinates.i'm creating new Points and passing them to the Drawline method of graphics.I have to re-arrange the co-ordinates ridiculously to make the lines fit inside the panel.am i doing something wrong? Here is the code: int pointTop = panel1.Top - 60; int pointBottom = panel1.Bottom - 85; int pointLeft = panel1.Left + 75 ; int pointRight = panel1.Right - 137 ; Point horTopLeft = new Point(panel1.Left - 15,panel1.Top - 15 ) ; Point horBottomLeft = new Point(panel1.Left -15,panel1.Top + 30 ) ; Point horTopRight = new Point(panel1.Right - 50,panel1.Top - 15) ; Point horBotRight = new Point(panel1.Right - 50,panel1.Top + 30 ) ; brush = new SolidBrush(Color.Black) ; myPen = new Pen(brush,5) ; topLeft = new Point(pointLeft,pointTop) ; topRight = new Point(pointRight,pointTop ) ; bottomLeft = new Point(pointLeft,pointBottom) ; bottomRight = new Point(pointRight,pointBottom) ; //Vertical Lines g.DrawLine(myPen,topLeft,bottomLeft) ; g.DrawLine(myPen,topRight,bottomRight) ; //Horizontal Lines g.DrawLine(myPen,horTopLeft,horTopRight) ; g.DrawLine(myPen,horBottomLeft,horBotRight) ;