Text controls do not follow margin Settings Topic is solved

Report problems with documented functionality
tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Text controls do not follow margin Settings

Post by tuzi » 26 May 2022, 02:51

Code: Select all

Gui, Margin, 10, 0
Gui, Add, Edit, Disabled, zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
Gui, Add, Text, Border vKHT, % Format("{:-4}{:-5}{:-7}{:-9}{:-19}{:-30}", "VK", "SC", "Flags", "Elapsed", "Key", "Extra")
Gui, Add, Text, Border vKH, % Format("{:-4}{:-5}{:-7}{:-9}{:-19}{:-30}", "00", "000", "ea!u", "1000.00", "Browser_Favorites", "KEY_IGNORE_ALL_EXCEPT_MODIFIER")

Gui, Show
return

GuiClose:
ExitApp
QQ截图20220526155203.png
QQ截图20220526155203.png (14.89 KiB) Viewed 609 times

lexikos
Posts: 9560
Joined: 30 Sep 2013, 04:07
Contact:

Re: Text controls do not follow margin Settings

Post by lexikos » 27 May 2022, 06:53

Text controls do follow the margin setting, as you will see if you decrease or increase the margin and compare.

When omit both X and Y, Text controls are given extra vertical deadspace for reasons described in the source code.

lexikos
Posts: 9560
Joined: 30 Sep 2013, 04:07
Contact:

Re: Text controls do not follow margin Settings  Topic is solved

Post by lexikos » 13 Jul 2022, 04:04

This is documented in v1.1.34.03.
If both X and Y are omitted, the control will be positioned beneath the previous control using a standard padding distance (the current margin). Consecutive Text or Link controls are given additional vertical padding, so that they typically align better in cases where a column of Edit, DDL or similar-sized controls are later added to their right. To use only the standard vertical margin, specify Y+M or any value for X.
Source: Gui - Syntax & Usage | AutoHotkey

Post Reply

Return to “Bug Reports”