As the gui is created, you can measure the size and position of each control and act accordingly:
Code: Select all
gui, -DPIScale +HwndGui
gui, font, s10
gui, add, text, , Hi
gui, add, edit, x+5 vName,
gui, add, text, x+5, % ", you can contact me on "
gui, add, DropDownList, x+5 vAddress, a@yahoo.com|a@gmail.com
DetectHiddenWindows, On
ControlGetPos, X,, Width,, ComboBox1, ahk_id %Gui% ;measure X and Width of DropDownList
GuiWidth := X + Width -3
;positions the left edge of the gui on the left edge of the DropDownList
gui, add, text, x+5, Thanks. ;this control to the right of the DropDownList will not be visible!
gui, show, w%GuiWidth% h200, MyGui
DetectHiddenWindows, Off
To wrap a control you would have to split it, i.e. create two conrols i.e. "control parts" .
However, the problem will be that these "control parts" will act independently.