ileandros Posted January 17, 2012 Share Posted January 17, 2012 Hi there, $List1 = GUICtrlCreateList("", 40, 35, 201, 110) GUICtrlSetData(-1," ") $Random = Random ('0x000000','0xFFFFFF') GUISetBkColor ($Random) $Random = Random ('10','20') Sleep ($Random) I'm trying to make this progg to have different colors and also i want the colors to change while i have the progg running. I managed to get this far but i didn't realy made it.I have some different colors each time i open the progg. Is there a way to make it change the colors while the progg is running??? I feel nothing.It feels great. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 17, 2012 Moderators Share Posted January 17, 2012 ileandros,You could use an Ablib function to change the colour at regular intervals. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ileandros Posted January 17, 2012 Author Share Posted January 17, 2012 (edited) I already did it but i get an error. Let me show u my progg and check it!! expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #include <IE.au3> Global $hGUI2 = 9999, $hButton3 = 9999 ; Predeclare the variables with dummy values to prevent firing the Case statements $hForm1 = GUICreate("", 674, 190, 195, 130) $oIE = _IECreateEmbedded() GUICtrlCreateObj($oIE,295,35,330,110) $hButton1 = GUICtrlCreateButton("One", 295, 150, 50, 25) $hButton3 = GUICtrlCreateButton("Two", 355, 150, 50, 25) $hButton2 = GUICtrlCreateButton("Three", 40, 150, 80, 25) $hButton4 = GUICtrlCreateButton("_Exit", 545, 150, 80, 25) $List1 = GUICtrlCreateList("", 40, 35, 201, 110) GUICtrlSetData(-1,"One | Two | Thee") $Random = Random ('0x000000','0xFFFFFF') GUISetBkColor ($Random) $Random = Random ('10','20') Sleep ($Random) $hGroup1 = GUICtrlCreateGroup("Radio List", 24, 16, 230, 170) GUICtrlCreateGroup("", -99, -99, 1, 1) $hGroup2 = GUICtrlCreateGroup("Browser", 280, 16, 365, 170) GUICtrlCreateGroup("", -99, -99, 1, 1) MsgBox(0, "Blocking", "Press me to continue") ; Just for test GUISetState(@SW_SHOW) While 1 WEnd Try to add a func for it and if u can help me! I didn't make it :/ Edited January 17, 2012 by ileandros I feel nothing.It feels great. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 17, 2012 Moderators Share Posted January 17, 2012 (edited) ileandros,I see no Adlib function in that code - are you sure you tried? M23Edit: You might want to use GUICtrlSetBkColor rather than GUISetBkColor. Edited January 17, 2012 by Melba23 Added a suggestion Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ileandros Posted January 17, 2012 Author Share Posted January 17, 2012 (edited) I did it but i delete it because i used to get errors :/I also get error with GUICtrlSetBkColor :/This is just how my progg looks like/is. Edited January 17, 2012 by ileandros I feel nothing.It feels great. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 17, 2012 Moderators Share Posted January 17, 2012 ileandros, Try this - it does not give me any errors: expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #include <IE.au3> #include <Color.au3> Global $hGUI2 = 9999, $hButton3 = 9999 ; Predeclare the variables with dummy values to prevent firing the Case statements $hForm1 = GUICreate("", 674, 190, 195, 130) ;$oIE = _IECreateEmbedded() ;GUICtrlCreateObj($oIE, 295, 35, 330, 110) $hButton1 = GUICtrlCreateButton("One", 295, 150, 50, 25) $hButton3 = GUICtrlCreateButton("Two", 355, 150, 50, 25) $hButton2 = GUICtrlCreateButton("Three", 40, 150, 80, 25) $hButton4 = GUICtrlCreateButton("_Exit", 545, 150, 80, 25) $Random = Random(0x000000, 0xFFFFFF, 1) $List1 = GUICtrlCreateList("", 40, 35, 201, 110) GUICtrlSetData(-1, "One | Two | Thee") GUICtrlSetBkColor($List1, $Random) $hGroup1 = GUICtrlCreateGroup("Radio List", 24, 16, 230, 170) $hGroup2 = GUICtrlCreateGroup("Browser", 280, 16, 365, 170) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) AdlibRegister("_Recolour", 1000) While 1 If GUIGetMsg() = -3 Then Exit WEnd Func _Recolour() $Random = Random(0x000000, 0xFFFFFF, 1) GUICtrlSetBkColor($List1, $Random) ; Get contrasting text colour If _ColorGetBlue($Random) < 0x50 Or _ ; Blue _ColorGetGreen($Random) < 0x50 Or _ ; Green _ColorGetRed($Random) < 0x50 Then ; Red $iText = 0xFFFFFF Else $iText = 0x000000 EndIf GUICtrlSetColor($List1, $iText) EndFunc M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ileandros Posted January 17, 2012 Author Share Posted January 17, 2012 Good Shot dude.That did it :DThank you. I was trying to do the same for the entire progg but i didn't make it. I tried the same thing as u did switch the $List with the $hForm1 but didn't manage to change the colours :/ Any tips. ? I managed to change the colour though but i cant make it keep changing :/ I feel nothing.It feels great. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 18, 2012 Moderators Share Posted January 18, 2012 ileandros,but i cant make it keep changingHave you used the Adlib function? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ileandros Posted January 18, 2012 Author Share Posted January 18, 2012 (edited) Yes, i used ur function and switch the $List1 with the $hForm1. I guess that didn't do it. It must be wrong written. :/ Edited January 18, 2012 by ileandros I feel nothing.It feels great. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 18, 2012 Moderators Share Posted January 18, 2012 ileandros,If you want the GUI to change colour then you need to change the GUICtrlSetBkColor lines into GUISetBkColor like this: expandcollapse popup#include <buttonconstants.au3> #include <guiconstantsex.au3> #include <guilistbox.au3> #include <windowsconstants.au3> #include <ie.au3> #include <color.au3> Global $hGUI2 = 9999, $hButton3 = 9999 ; Predeclare the variables with dummy values to prevent firing the Case statements $hForm1 = GUICreate("", 674, 190, 195, 130) $Random = Random(0x000000, 0xFFFFFF, 1) GUISetBkColor($Random) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ;$oIE = _IECreateEmbedded() ;GUICtrlCreateObj($oIE, 295, 35, 330, 110) $hButton1 = GUICtrlCreateButton("One", 295, 150, 50, 25) $hButton3 = GUICtrlCreateButton("Two", 355, 150, 50, 25) $hButton2 = GUICtrlCreateButton("Three", 40, 150, 80, 25) $hButton4 = GUICtrlCreateButton("_Exit", 545, 150, 80, 25) $List1 = GUICtrlCreateList("", 40, 35, 201, 110) GUICtrlSetData(-1, "One | Two | Thee") $hGroup1 = GUICtrlCreateGroup("Radio List", 24, 16, 230, 170) $hGroup2 = GUICtrlCreateGroup("Browser", 280, 16, 365, 170) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) AdlibRegister("_Recolour", 1000) While 1 If GUIGetMsg() = -3 Then Exit WEnd Func _Recolour() $Random = Random(0x000000, 0xFFFFFF, 1) GUISetBkColor($Random) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< EndFuncM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ileandros Posted January 19, 2012 Author Share Posted January 19, 2012 Yes this works. I'm not good at all at this :/ Whats the diff between GuiCTRLSetBkColor and GuiSetBkColor???? Thank you for ur help I feel nothing.It feels great. Link to comment Share on other sites More sharing options...
BrewManNH Posted January 19, 2012 Share Posted January 19, 2012 Yes this works. I'm not good at all at this :/Whats the diff between GuiCTRLSetBkColor and GuiSetBkColor????Thank you for ur help Don't you have the help file that came with the AutoIt 3 download? It would seem to be pretty obvious what the differences are once you read it. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted January 19, 2012 Moderators Share Posted January 19, 2012 Hi ileandros. Run the example scripts in the help file for the two - you will see the difference immediately. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
ileandros Posted January 19, 2012 Author Share Posted January 19, 2012 I just run the examples given from the download help files and i think i got the differencer but i guess im not that good at this program that's why im getting confused. Anyway im gonna get better Thanks all guys. I feel nothing.It feels great. Link to comment Share on other sites More sharing options...
ileandros Posted January 22, 2012 Author Share Posted January 22, 2012 Hey guys besides than changing the color of the background can i also add images/icons or sth else as a background???? I feel nothing.It feels great. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 22, 2012 Moderators Share Posted January 22, 2012 ileandros,You can use an image as a background with GUICtrlCreatePic - but make sure you read the Remarks section of the Help file page very carefully. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
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