I have written an application in Delphi. To the window state of a form I've given wsMaximized. There are three buttons on the form which are anchored to the left, top and bottom. When I run the app on my own laptop I can see all three buttons but when I run it on other computers sometimes the buttons are completelely not visible, sometimes i can see only one. And I can't anyhow reach hose buttons. However, if I change the screen resolution I can see them. But with some computers I can't see them even with the maximum resolution provided. What sould I do with this problem?
Asked
Active
Viewed 1,042 times
3 Answers
5
Buttons generally have a fixed height and width. This in turn implies that they should be anchored to top or bottom, but not both. Likewise they should be anchored to left or right, but not both.
Your buttons are anchored to both top and bottom which seems wrong. I'd guess your solution is to pick just one of top or bottom anchors.

David Heffernan
- 601,492
- 42
- 1,072
- 1,490
-
1+1, aligning to both [Top and Bottom] or both [Left and Right] should be reserved for controls that can be stretched, like panels or page controls; Never for fixed controls like buttons, edit boxes, etc. And always have a target minimum resolution (example: 800 x 600), make sure you design-time forms are not larger then that. If you do that, it'll work on the client PC, and if it doesn't you can blame it on them for not having the minimum required resolution. – Cosmin Prund Jul 04 '11 at 11:00
-
@Cosmin : IME it is very common to assign both left and right anchor of edits - so that when the form is made wider (by user) then the fields are getting wider too. – ain Jul 04 '11 at 13:10
-
@Cosmin I always wondered why csFixedWidth and csFixedHeight (TControlStyle) don't automatically interfere with the Anchors property. – NGLN Jul 04 '11 at 20:21
1
The bottom anchor is squishing the buttons effectively giving them a negative height. You could set a Minimum height for the button to prevent this from happening or you could remove the bottom anchor.

James
- 9,774
- 5
- 34
- 58