by james kahl (8 Submissions)
Category: Miscellaneous
Compatability: VB Script
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating:
(2 Votes)
This is in response to M1K3's submission about centering a form over a picture box. I don't want to rip into the flaws of his methodology and will only say that there were far too many assumptions on his part. I think this method is a much better alternative since you don't need to make sure that your form is a specific size, or the parent form or picture box has their properties set to specific values. Should be good for beginners since I use SystemParametersInfo with SPI_GETNONCLIENTMETRICS to determine border width of forms and height of Titlebars for forms.
API DeclarationsSystemParametersInfo