Hallo, ich habe ein kleines Problem, das sich aber sicher schnell lösen lässt.
Ich würde gerne eine Child-Gui an den Rand einer Parent-Gui andocken und die Position auch nach dem Verschieben der Parent-Gui beibehalten.
Wie soll man an die Sache rangehen?
Hier ein kleines Beispielscript dafür:
Spoiler anzeigen
Global $sTitle = "Parent", $iWidth = 500, $iHeight = 140
Global $iChildWidth = 40, $iChildHeight = 140
Global $bChild = False
$hGui = GUICreate ($sTitle, $iWidth, $iHeight)
$hCreateChild = GUICtrlCreateButton ("Child", 200, 110, 100, 20)
GUISetState (@SW_SHOW, $hGui)
[/autoit] [autoit][/autoit] [autoit]While True
$nMsg = GUIGetMsg (1)
Select
Case $nMsg[0] = -3 And $nMsg[1] = $hGui
Exit
Case $nMsg[0] = $hCreateChild
If $bChild = False Then
$aPos = WinGetPos ($hGui)
$hChild = GUICreate ("", $iChildWidth, $iChildHeight, $aPos[0] + $aPos[2] + 10, $aPos[1] + 24, 0x80880000, -1, $hGUI)
GUISetState (@SW_SHOW, $hChild)
Global $bChild = True
ElseIf $bChild = True Then
GUIDelete ($hChild)
Global $bChild = False
EndIf
EndSelect
WEnd