1. This certainly points out that the documentation for -Wrap (and word wrapping in general) is sparse, at best. Nowhere does it discuss how the wrapping is done (splitting a SPACE or, I assume, TAB positions. And if it Splits at other positions they are not defined.
2. One can force the width of 100 as shown below for Button2.
Code: Select all
#NoEnv
text2 := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
Gui, Margin, 150, 20
Gui, Add, Button, w100, Common Button
Gui, Add, Button, w100 hwndHBTN vButton2 ; will maintain width 100
Gui, Add, Button, w100 hwndHBTN -Wrap, %text2%
Gui, Add, Button, w100 hwndHBTN +Wrap, %text2%
ControlGet, Styles1, Style, , , ahk_id %HBTN%
Gui, Add, Button, w100 hwndHBTN, Text Is Wider Than 100 Pixel
ControlGet, Styles2, Style, , , ahk_id %HBTN%
GuiControl,, Button2, %text2%
Gui, Show, , Button Test
Return
GuiClose:
ExitApp