That event is not a place to be doing such things.
when you change the size of a component it loops because just about everything twitch in a control ends up triggering that.
You have two options.
Put a block on that function..
Const B:Busy = false
if B then exit else B := True;
do your code.
B := False;
or/...
Try using the OChangeBounds event instead.