Lock Middle on Maximize

Does anybody have a method that can help me? I develop accounting software that has a ton of windows. Looking for a method that will allow me to call it to set the middle position of each control item when maximizing the window. Need to reuse it with any different window I pass to it. Was going in the direction of a function using for i as integer = 1 to Window1.ControlCount. Not sure if this is the right direction to be thinking or if somebody has a better way of automatically maximizing the window based on how it is set in the original size. Thanks- Cleve

example for a label

Calculate xx based on the size of the window

dim mywin as Window = Window1 // your Window name here dim theCtrl as Control for i as integer = 0 to mywin.ControlCount-1 theCtrl = mywin.Control(i) if theCtrl isa Label then Label(theCtrl).TextSize = xx Label(theCtrl).Left = xx Label(theCtrl).Top = xx Label(theCtrl).Width = xx Label(theCtrl).Height = xx end if next

You’re a genius. Just couldn’t figure it out. Thanks- Cleve