rote- grüne flächen?

08/30/2010 12:13 *-_JuLi²_-*#1
hayy ich wollte mal fragen wie ich in autoit so rote bzw. grüne flächen mache
da ich einen Hack versuch starten wollte und wenn ich auf "ON" klicke soll das feld grün sein wie geht das?!:confused:
08/30/2010 12:39 lolkop#2
Code:
GUICreate('bleh', 100, 100, -1, -1, 0x10080000)
GUICtrlCreateLabel('', 10, 10, 80)
GUICtrlSetBkColor(-1, 0x00FF00)
GUICtrlCreateLabel('', 10, 40, 80)
GUICtrlSetBkColor(-1, 0xFF00000)

Do
Until GUIGetMsg()=-3
08/30/2010 12:43 *-_JuLi²_-*#3
ehhm ich meine eig. wie man auf knopfdruck eine rote fläche auf grün macht

Edit: Ich habs dank dir *thx geb*
09/01/2010 02:20 Lawnmove#4
Mit GUICtrlSetData($button3, "AN") steuerst du den an

$Button3 = GUICtrlCreateButton("AUS", 179, 24, 33, 25)
GUICtrlSetFont(-1, 10, 800, 0, "Myriad Web")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFF0000)

Anstatt Button kannst auch Label machen !
09/01/2010 21:09 maxi39#5
oder so mach ich es immer, is eig dasselbe

Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 445, 192, 124)
$Graphic1 = GUICtrlCreateGraphic(224, 32, 84, 36)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, 0xFF0000)
$Button1 = GUICtrlCreateButton("on", 40, 32, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("off", 128, 32, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

case $Button2
	 GUICtrlSetBkColor($Graphic1, 16711680)
 case $Button1
	 GUICtrlSetBkColor($Graphic1, 65280)

	EndSwitch
WEnd
09/02/2010 02:06 Lawnmove#6
maxi39
Habs noch was verfeinert. Nette Idee mit Graphic
Ich nahm bisher immer Buttons.