Hallo,
ich geb mich für heute geschlagen...
Folgendes Problem:
1. Meine Form hat mehrere Buttons
2. Ich drücke die TAB Taste um zu den Buttons zu springen
soweit ok!
Nun ermittele ich die jeweilige ID und vergrößere den Button. Das klappt auch.
Aber dann:
Drücke ich den TAB erneut, dann soll der "vergrößerte Button" wieder an den Ursprungsort zurück
und dann der nächste vergrößert werden. Das krieg ich nicht hin.
Zum Testen einfach nur die TAB-Taste drücken
Mein Code:
Spoiler anzeigen
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <WinAPI.au3>
$hwndMain = GUICreate("Form1", 543, 443, 192, 124)
$Combo1 = GUICtrlCreateCombo("Combo1", 48, 48, 145, 25)
$Button1 = GUICtrlCreateButton("Button1", 48, 104, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Button2", 136, 104, 75, 25, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Button3", 224, 104, 75, 25, $WS_GROUP)
$Button4 = GUICtrlCreateButton("Button4", 312, 104, 75, 25, $WS_GROUP)
$Button5 = GUICtrlCreateButton("Button5", 408, 104, 75, 25, $WS_GROUP)
$Button6 = GUICtrlCreateButton("Button6", 48, 144, 75, 25, $WS_GROUP)
$Button7 = GUICtrlCreateButton("Button7", 136, 144, 75, 25, $WS_GROUP)
$Button8 = GUICtrlCreateButton("Button8", 224, 144, 75, 25, $WS_GROUP)
$Button9 = GUICtrlCreateButton("Button9", 312, 144, 75, 25, $WS_GROUP)
$Button10 = GUICtrlCreateButton("Button10", 408, 144, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
GUISetState(@SW_MAXIMIZE)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
[/autoit] [autoit][/autoit] [autoit]If _IsPressed(09)Then
[/autoit] [autoit][/autoit] [autoit]_Buttonpos()
[/autoit] [autoit][/autoit] [autoit]endif
WEnd
func _Buttonpos()
Local $pos[4]
Local $control = ControlGetFocus($hwndMain)
Local $hHandle = ControlGetHandle($hwndMain, "", $control); Handle des selektierten Controls holen
Local $ICtrlId = _WinAPI_GetDlgCtrlID($hHandle); CtrlId aus dem Handle erstellen
MsgBox(0, "Button-ID", $ICtrlId,1)
$pos = ControlGetPos("", "", $ICtrlId)
GUICtrlSetPos($ICtrlId, -1,-1,@DesktopWidth/2,@DesktopHeight-200); Button wird vergrößert
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]endfunc
[/autoit]Ich möchte einfach nur per TAB z.B. zum 4. Button gehen
und der sollte dann automatisch z.B. nach 1 Sekunde vergrößert werden
Liebe Grüße
Ilse
P.S. Besser wäre natürlich die Navigation mit den Pfeiltasen
Aber das klappt nicht