eJan Posted March 27, 2005 Posted March 27, 2005 Can it be done to overwrite previously created GuiCtrlCreateGraphic with new one (like on the pic)?Script:#include "GUIConstants.au3"GUICreate("Graphic",130 ,100)$g1 = GuiCtrlCreateGraphic(10, 10, 80, 80, 0)GUICtrlSetGraphic($g1, $GUI_GR_COLOR, 0x000000)GUICtrlSetGraphic($g1, $GUI_GR_RECT, 0, 0, 80, 80)$g2 = GuiCtrlCreateGraphic(60, 20, 60, 60, 0)GUICtrlSetGraphic($g2, $GUI_GR_COLOR, 0xFF0000)GUICtrlSetGraphic($g2, $GUI_GR_RECT, 0, 0, 60, 60)GuiCtrlCreateLabel("label", 60, 42, 60, 20, $SS_CENTER)GUISetState()Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE(working only when i set GUICtrlSetBkColor, but I don't want to use background color). AI v3.1.0.15J
zcoacoaz Posted March 28, 2005 Posted March 28, 2005 (edited) Like this?#include "GUIConstants.au3" GUICreate("Graphic",130 ,100) $g1 = GuiCtrlCreateGraphic(10, 10, 80, 80, 0) GUICtrlSetGraphic($g1, $GUI_GR_COLOR, 0x000000) GUICtrlSetGraphic($g1, $GUI_GR_RECT, 0, 0, 80, 80) $g2 = GuiCtrlCreateGraphic(60, 20, 60, 60, 0) GUICtrlSetBkColor($g2,0xece9d8) GUICtrlSetGraphic($g2, $GUI_GR_COLOR, 0xFF0000) GUICtrlSetGraphic($g2, $GUI_GR_RECT, 0, 0, 60, 60) GuiCtrlCreateLabel("label", 60, 42, 60, 20, $SS_CENTER) GUISetState() Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE edit: sorry, i mis-understood you now i have a correct example Edited March 28, 2005 by Xenogis [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]
eJan Posted March 28, 2005 Author Posted March 28, 2005 Actually I need to convert [HKEY_CURRENT_USER\Control Panel\Colors]"ButtonFace"="236 233 216" to 'Hex' and set it to GUICtrlSetBkColor($g2, ?), where "0xece9d8" is my Windows theme color, but supposed that I don't know other users Theme colors used.
zcoacoaz Posted March 28, 2005 Posted March 28, 2005 $RGB = StringSplit ( RegRead ( "HKCU\Control Panel\Colors", "ButtonFace" ), " " ) $Hex = "0x" & Hex ( $RGB[1], 2 ) & Hex ( $RGB[2], 2 ) & Hex ( $RGB[3], 2 ) #include "GUIConstants.au3" GUICreate("Graphic",130 ,100) $g1 = GuiCtrlCreateGraphic(10, 10, 80, 80, 0) GUICtrlSetGraphic($g1, $GUI_GR_COLOR, 0x000000) GUICtrlSetGraphic($g1, $GUI_GR_RECT, 0, 0, 80, 80) $g2 = GuiCtrlCreateGraphic(60, 20, 60, 60, 0) GUICtrlSetBkColor($g2,$hex) GUICtrlSetGraphic($g2, $GUI_GR_COLOR, 0xFF0000) GUICtrlSetGraphic($g2, $GUI_GR_RECT, 0, 0, 60, 60) GuiCtrlCreateLabel("label", 60, 42, 60, 20, $SS_CENTER) GUISetState() Do $msg = GUIGetMsg() Until $msg = $GUI_EVENT_CLOSE [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now