Code: Select all
Gui, Color, 0
Gui, +E0x02000000 +E0x00080000
Gui, Font, s20, Tahoma
Gui, Add, Text, x10 y10 cRed, GROUP 1
Gui, Font, s8, Tahoma
; -----------------------------------------------
; Group 1
Gui, Add, ListBox, x10 y+10 w100 h40 hWndB1, A|B|C
MyClass.Test(B1, 100, 60)
GuiControlGet, Pos, Pos, %B1%
FileAppend, X: %PosX% Y: %PosY% W: %PosW% H: %PosH%`n,*
Gui, Add, Button, y+10 w100 h40, Button
; ---------
Gui, Font, s20, Tahoma
Gui, Add, Text, x200 y10 cRed, GROUP 2
Gui, Font, s8, Tahoma
; -----------------------------------------------
; Group 2
Gui, Add, ListBox, x200 y+10 w100 h60, A|B|C
Gui, Add, Button, xp y+10 w100 h40, Button
; -----------------------------------------------
Gui, Show, w400 h200, GUI
Return
Class MyClass {
Test(hWnd, W, H) {
GuiControl, MoveDraw, %hWnd%, w%W% h%h%
}
}
Gui, Add, Button, y+10 w100 h40, Button
the y+10 dont align the control as in group2?
as the height of the listbox has been modified from 40 to 60 before the button control has been created?
What i could do, to any new control being created with x+ or y+ take as base the height modified by GuiControl, Move ?