I assume from what you say that this is basically "how do I get the length of a line between two points that I click with the mouse?" - since you imply that you can already draw the shapes.
If so, then it is really, really easy: just use Pythagoras!
Point startPoint = new Point(0, 0);
bool down = false;
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
startPoint = e.Location;
down = true;
}
private void panel1_MouseMove(object sender, MouseEventArgs e)
{
if (down)
{
Point endPoint = e.Location;
double length = Math.Sqrt(Math.Pow(endPoint.X - startPoint.X, 2) + Math.Pow(endPoint.Y - startPoint.Y, 2));
label1.Text = length.ToString();
}
}
private void panel1_MouseUp(object sender, MouseEventArgs e)
{
down = false;
}