Page 1 of 1

Text controls do not follow margin Settings

Posted: 26 May 2022, 02:51
by tuzi

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 641 times

Re: Text controls do not follow margin Settings

Posted: 27 May 2022, 06:53
by lexikos
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.

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

Posted: 13 Jul 2022, 04:04
by lexikos
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