Is there an easy way to get the nearest control to a control of choice?
I have a picture box and some other moving controls. I want to delete the nearest control to my picture box.
So I have to get the position of all controls and delete that with the Location nearest to the Location of my picture box. I’m not sure about how to do that the best way.
If “closest” in your case indeed means “with the Location nearest to the Location of my picture box”, then the easiest would be:
, where Distance is defined in a module like this: