Simple subtraction.

formX = mouseX - form1.left
formY = mouseY - form1.top

formMaxX = form1.left + form1.width
formMaxY = form1.top + form1.height



or something along those lines.