Hey,
gibt es eine Funktion die etwas in eine bestimmte Richtung z.B. bewegt?
Ein Beispiel:
Ein Button wird gedrückt und plötzlich geht ein Bild nach oben.?
Hey,
gibt es eine Funktion die etwas in eine bestimmte Richtung z.B. bewegt?
Ein Beispiel:
Ein Button wird gedrückt und plötzlich geht ein Bild nach oben.?
WinMove()
GUICtrlSetPos()
Kommt halt drauf an, was du "bewegen" willst.
einen anderen Button scriptintern zum Beispiel? wie wäre es dann?
Hat i2c schon geschrieben.
[autoit]GUICtrlSetPos()
[/autoit]....wenns nur ums bewegen geht...
#include <WinAPI.au3>
[/autoit] [autoit][/autoit] [autoit]$anz = 10
[/autoit] [autoit][/autoit] [autoit]Global $button[$anz + 1], $x[$anz + 1], $y[$anz + 1]
$gui = GUICreate("Test", 600, 600)
For $i = 1 To $anz
$button[$i] = GUICtrlCreateButton($i, 10 + Random(20, 500, 1), 10 + Random(20, 500, 1), 20, 20)
Next
GUISetState(@SW_SHOW, $gui)
$variable = 0
AdlibRegister("_move", 1000)
While guigetmsg()<>-3
For $i = 1 To $anz
$a = ControlGetPos($gui, "Test", $button[$i])
If $a[0] < 10 Then $x[$i] = -$x[$i]
If $a[1] < 10 Then $y[$i] = -$y[$i]
If $a[0] > 490 Then $x[$i] = -$x[$i]
If $a[1] > 490 Then $y[$i] = -$y[$i]
ControlMove("Test", "", $button[$i], $a[0] + $x[$i], $a[1] + $y[$i], $a[0] / 10, $a[0] / 10)
Next
WEnd
Exit
Func _move()
For $i = 1 To $anz
$x[$i] = Random(-2, +2, 1)
$y[$i] = Random(-2, +2, 1)
Next
_WinAPI_RedrawWindow($gui)
EndFunc ;==>_move