Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programatically center an image control..
Message
 
 
To
10/01/2007 08:07:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 6
Miscellaneous
Thread ID:
01182600
Message ID:
01184136
Views:
16
>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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform