darkxraver Posted February 23, 2009 Share Posted February 23, 2009 (edited) once again i have a problem.. i tried and tried and searched but cant manage to find a solution.. heres a part of my script $earth1 = GUICtrlCreateInput($e1ini, 45, 70, 55, 20,$ES_READONLY) $low = GUICtrlCreateCheckbox("Highlight Low Elements", 5, 366) Case BitAND(GUICtrlRead($low), $GUI_CHECKED) Switch GUICtrlRead($earth1) Case 0 to 1999 GUICtrlSetBkColor($earth1, 0xff0000) EndSwitch Case BitAND(GUICtrlRead($low), $GUI_UNCHECKED) GUICtrlSetBkColor($earth1, 0xEBE9ED) EndSelect it should do the exact same thing like this code but for some reason the GUICtrlCreateInput which is $earth1 is flimmering/flickering or glimmers or what you wanna call it.. is there another solution so that it wont flimmer/flicker/glimmer? if the value of $earth1 is from <= 1999 (0-1999) and the checkbox $low is checked it should change the background of the GUICtrlCreateInput to red if the value of $earth1 is from >= 2000 and the checkbox $low is checked or the checkbox $low is unchecked it should change the background of the GUICtrlCreateInput to the standart color which is grey any way to do this? thx Edited February 23, 2009 by darkxraver Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 23, 2009 Moderators Share Posted February 23, 2009 darkxraver, It is a common problem - you are setting the backcolour on every loop, even if there is no change, which causes the flicker. The solution is to use a flag to check for a change in state and only then change the backcolour:expandcollapse popup#include <GUIConstantsEx.au3> #include <EditConstants.au3> GUICreate("Test", 200, 200) $earth1 = GUICtrlCreateInput("", 45, 70, 55, 20,$ES_READONLY) $low = GUICtrlCreateCheckbox("Highlight Low Elements", 25, 166) ; $fLow_Checked is boolean and matches the state of checkbox: 1 = checked, 0 = unchecked $fLow_Checked = 0 GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch If BitAND(GUICtrlRead($low), $GUI_CHECKED) <> $fLow_Checked Then $fLow_Checked = Not $fLow_Checked ; make the state boolean match the checkbox If $fLow_Checked Then Switch GUICtrlRead($earth1) Case 0 to 1999 GUICtrlSetBkColor($earth1, 0xff0000) EndSwitch Else GUICtrlSetBkColor($earth1, 0xEBE9ED) EndIf EndIf WEnd It means a bit more coding, but a much nicer GUI at the end. 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...
darkxraver Posted February 23, 2009 Author Share Posted February 23, 2009 (edited) oh ic x-x its simple if you know how x: thanks a bunch i have to give credits to you guys since you help me out alot Edit: and the thing is i never scripted something that "big" only a few lines.. and here i am already at 648 lines and im already starting to lose track cause of so many lines Edited February 23, 2009 by darkxraver Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 23, 2009 Moderators Share Posted February 23, 2009 darkxraver,I presume you are using SciTE. Try using the #Region....#EndRegion directives. They allow you to "shrink" parts of your code that you are not working on. look at this:#Region ; Now you see me! #EndRegion #Region - Title 2 ; I am visible! #EndRegionJust click on the little [-] boxes that appear in SciTE next to the #Region lines. Or you can use "View - Toggle all folds" from the menu. Do not forget to put a suitable title after #Region, or you will not know what is hidden where!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