- Offizieller Beitrag
Wenn ich ein Graphic-Control erstelle, dann kann ich die Graphic nicht mit GUICtrlSetState(-1, $GUI_HIDE) verstecken, warum?
Beispiel:
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
Opt('MustDeclareVars', 1)
Opt('GUIOnEventMode', 1)
Global $dig[10]
GUICreate('test', 800, 480, -1, -1, $WS_POPUP, BitOr($WS_EX_TOOLWINDOW, $WS_EX_LAYERED))
GUISetOnEvent($GUI_EVENT_CLOSE,'_End')
GUISetBKColor(0xC0C0C0) ; Hintergrundfarbe setzen
$dig[8] = GUICtrlCreateGraphic(0, 0, 32, 56)
GUICtrlSetBkColor(-1, 0xC0C0C0)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0, 0xffff88)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, 0) ; a
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 8, ![]()
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 24, ![]()
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 32, 0)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 32, 0) ; b
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 24, ![]()
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 24, 24)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 32, 28)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 32, 28) ; c
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 24, 32)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 24, 48)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 32, 56)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, 56) ; d
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 8, 48)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 24, 48)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 32, 56)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, 28) ; e
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 8, 32)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 8, 48)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 0, 56)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, 0) ; f
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 8, ![]()
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 8, 24)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 0, 28)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, 28) ; g
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 8, 24)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 24, 24)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 32, 28)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 24, 32)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 8, 32)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 0, 28)
GUICtrlSetState($dig[8], $GUI_HIDE) ; <-- funktioniert nicht
GUICtrlCreatePic(@ScriptDir & '\nicht loeschen.gif', 0, 0, 1, 1) ; wird für die Transparenz benötigt (nicht löschen)
GUISetState()
While 1
Sleep(100)
WEnd
Func _End()
Exit
EndFunc
Falls das sowieso nicht geht, wäre mein zweite Frage:
Wie kann ich die Graphic periodisch verändern? Mit GUICtrlDelete und anschließendem Neuzeichnen führt das zu einem üblen Geflacker.