#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Gráficos - Juan A. Villalpando", 539, 372, 192, 132)
$Button1 = GUICtrlCreateButton("Button1", 80, 264, 153, 57)
$Button2 = GUICtrlCreateButton("Button2", 312, 264, 153, 57)
$Graphic1 = GUICtrlCreateGraphic(96, 56, 113, 97) ; Cuadrado
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xFF0000)
$Graphic2 = GUICtrlCreateGraphic(324, 56, 113, 97) ; Círculo
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0x000000, 0xFF0000)
GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 10, 0, 100, 100)
GUISetState(@SW_SHOW)
; Juan A. Villalpando. KIO4.COM
#EndRegion ### END Koda GUI section ###
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button1 ; Rojo
GUICtrlSetBkColor($Graphic1, 0xFF0000)
GUICtrlSetGraphic($Graphic1, $GUI_GR_REFRESH)
GUICtrlSetGraphic($Graphic2, $GUI_GR_COLOR, 0x000000, 0xFF0000)
GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 10, 0, 100, 100)
GUICtrlSetGraphic($Graphic2, $GUI_GR_REFRESH)
Case $msg = $Button2 ; Azul
GUICtrlSetBkColor($Graphic1, 0x0000FF)
GUICtrlSetGraphic($Graphic1, $GUI_GR_REFRESH)
GUICtrlSetGraphic($Graphic2, $GUI_GR_COLOR, 0x000000, 0x0000FF)
GUICtrlSetGraphic(-1, $GUI_GR_ELLIPSE, 10, 0, 100, 100)
GUICtrlSetGraphic($Graphic2, $GUI_GR_REFRESH)
EndSelect
Wend
Exit
|