Can some one help me with this. on a form I have placed two rounded rectangles Shape1 and Shape2 and 2 lines Line1 and Line2. The two rectangles will allways be side by side and aligned by top. I want the two lines to connect the rectangles top and bottom to produce a simple cross section display of a tube, the dimensions of which vary by varying the rectangles sizes (they are always both the same size)
The problem I have is that the top line <Line1> always connects perfectley but the bottom line <Line2> will not always align with the bottom of the two rectangles, and instead positions a fraction lower. the code I used to position the lines is this
The problem does not always happen, sometimes it gets it smack on, but it depends on the height of Shape2. What am I doing wrong?Code:Line1.Y1 = Shape2.Top Line1.Y2 = Shape2.Top Line1.X1 = Shape1.Left + (Shape1.Width / 2) Line1.X2 = Shape3.Left + (Shape2.Width / 2) Line2.Y1 = Line1.Y1 + Shape2.Height ' this is the problem Line2.Y2 = Line1.Y1 + Shape2.Height Line2.X1 = Shape1.Left + (Shape1.Width / 2) Line2.X2 = Shape3.Left + (Shape2.Width / 2)
Can anyone help me here as I am starting to go a bit loopy!!
Many thanks
Ray




Reply With Quote