Not bad, but you should take into account that changing the Panel Bounds, you are affecting mouse coordinates, too, impacting on the subsequent Mouse Move event. This creates a trembling effect. You want the window to follow the mouse, so basically mouse coords should be kept constants after each hop (see the change in case True into Mouse Move).
Second, you may want to switch off tracking when the mouse jumps out of the window, because in this case you are no longer able to track its movement, so I added Mouse Leave to the Mouse Up event handler.
Moreover, I added a timeout just to limit the event processing frequence, but this is not so important and you may want to entirely remove this change. The flaw here is that the longer the timeout, the greater is the probability to loose mouse tracking.
Finally, in my tests the overall effect of this management is to slightly increase the window size. I admit I don't understand this behaviour, so far.
Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021