Ooh, I see. How about this? When you get a click-event and the cursor is in the area where the dragging is possible you save the starting coords (you can use them as a flag, for instance if you're not dragging the coords are set to 0/0 or -1/-1 or something, you get the idea) and redraw it from the starting point to the current cursor position whenever the mouse is moved. When the key is released again you do the calculation what's inside the box and continue with whatever you wanna do.
I've never done something like this before though, it's just an idea.