Box Scale?

Hey, I just thought of something that I wanted to try. Only, I don’t know where to start. I want to make it so when you click, it makes the first point of a square. (Upper left point) So you click and it starts a square from that point, and scales the box depending where you drag the mouse. Get it? I thought it would have something to do with scaleing, but all my attempts ahave failed so far. Kinda like highlighting. I have other ideas to, but they are based off this one.