How to draw a self-erasing line or rubber-band line from a base point to the
current mouse point?

Or is this the domain of C# / C++?

The basic idea is to repeatedly drawing a object (i.e. example a line) from
a base point (started by clicking once on the left mouse button) to the tracked
mouse position, then undrawing it before drawing the next object. A second
left mouse click should indicate the final point to draw to.

Kind regards,