>Hi Sergey, thanks for your reply. But can you help me with this?
>
>I'm trying to center unknown number of image controls in a maximized form. All controls width is 75, with distance of 200 each.
>
>Simple mathematics, but I just can't figure it out :(
If you have N controls than thre're n-1 gaps between them. Assuming that you want the same gaps on the left and right
lnDistance = 200
lnImgWidth = 75
lnFormWidth = _SCREEN.Width
lnImgCount = INT( (lnFormWidth - lnDistance) / (lnImgWidth + lnDistance) )
lnLeft = (lnFormWidth - (lnImgCount * lnImgWidth) - ((lnImgCount-1) * lnDistance)) / 2
--sb--