How to detect mouse event while painting in a loop

Printable View