A rectangular shape is being drawn by setting the Height and Width properties of the Rectangle class, along with the stroke color and the thickness of it. To create a square, you can use this shape by setting its dimension properly.
In the second example, a circular shape has been drawn using the Ellipse control. It uses the same property sets to create the shape. To make it a complete circle, set its Height and Width to the same value.
If you want to draw a straight line in the UI, use the Line class. It exposes four properties to draw the line. Set the X1 and Y1 properties to mark the starting point; set X2 and Y2 properties to mark the ending point of the line. In the preceding example, a line has been drawn from the (10,80) coordinate point to the (190,20) coordinate point.
In the fourth example, we have seen how to create a series of connected straight lines using the Polyline shape control. You need to set the (X, Y) coordinate points of the lines in its Points...