danielmohr91 Posted December 17, 2009 Posted December 17, 2009 (edited) I'm having a problem on one of my GUI's. I recreated the problem here. When I change the backround color of a slider, it shows through to the other tabs upon opening. I've tried using GUISetState() and GUISetState(@SW_SHOW) with no success. As you've probably noticed, I'm not real experienced with AutoIt yet. Any way around this? How would I fix this? It looks funny having the defualt grey background for the slider, on a white tab... I've recreated the problem here in a simple, easy to read code: expandcollapse popup;testing tab glitch with bk color #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Glitch", 441, 286, 192, 124) $Tab1 = GUICtrlCreateTab(40, 64, 369, 193) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("1") $Button2 = GUICtrlCreateButton("Am I covered?", 112, 128, 209, 105, $WS_GROUP) $TabSheet2 = GUICtrlCreateTabItem("2") $Slider2 = GUICtrlCreateSlider(72, 96, 265, 41) $Button1 = GUICtrlCreateButton("Pink", 144, 216, 145, 25, $WS_GROUP) $TabSheet3 = GUICtrlCreateTabItem("3") $Slider1 = GUICtrlCreateSlider(72, 152, 305, 33) $Label1 = GUICtrlCreateLabel("Slider", 128, 128, 30, 17) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUICtrlSetBkColor($Slider1, 0xFFFFFF) GUICtrlSetBkColor($Slider2, 0xFFFFFF) GUICtrlSetBkColor($Button2, 0xD02875) GUISetState() GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited December 17, 2009 by danielmohr91
BennyBB Posted December 17, 2009 Posted December 17, 2009 (edited) Hey this should work now. I've just set the color directly after creating the control and not at the end of the gui section: expandcollapse popup;testing tab glitch with bk color #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Glitch", 441, 286, 192, 124) $Tab1 = GUICtrlCreateTab(40, 64, 369, 193) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("1") $Button2 = GUICtrlCreateButton("Am I covered?", 112, 128, 209, 105, $WS_GROUP) GUICtrlSetBkColor(-1, 0xD02875) $TabSheet2 = GUICtrlCreateTabItem("2") $Slider2 = GUICtrlCreateSlider(72, 96, 265, 41) GUICtrlSetBkColor(-1, 0xFFFFFF) $Button1 = GUICtrlCreateButton("Pink", 144, 216, 145, 25, $WS_GROUP) $TabSheet3 = GUICtrlCreateTabItem("3") $Slider1 = GUICtrlCreateSlider(72, 152, 305, 33) GUICtrlSetBkColor(-1, 0xFFFFFF) $Label1 = GUICtrlCreateLabel("Slider", 128, 128, 30, 17) GUICtrlCreateTabItem("") #EndRegion ### END Koda GUI section ### GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited December 17, 2009 by BennyBB
ichigo325 Posted December 17, 2009 Posted December 17, 2009 You've made a small mistake, i found a solution.. expandcollapse popup;testing tab glitch with bk color #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <SliderConstants.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Glitch", 441, 286, 192, 124) $Tab1 = GUICtrlCreateTab(40, 64, 369, 193) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("1") $Button2 = GUICtrlCreateButton("Am I covered?", 112, 128, 209, 105, $WS_GROUP) $TabSheet2 = GUICtrlCreateTabItem("2") $Slider2 = GUICtrlCreateSlider(72, 96, 265, 41) $Button1 = GUICtrlCreateButton("Pink", 144, 216, 145, 25, $WS_GROUP) $TabSheet3 = GUICtrlCreateTabItem("3") $Slider1 = GUICtrlCreateSlider(72, 152, 305, 33) $Label1 = GUICtrlCreateLabel("Slider", 128, 128, 30, 17) ;~ GUICtrlCreateTabItem("") ; <- this is the problem ;~ GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUICtrlSetBkColor($Slider1, 0xFFFFFF) GUICtrlSetBkColor($Slider2, 0xFFFFFF) GUICtrlSetBkColor($Button2, 0xD02875) ;~ GUISetState() GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd [size="2"][font="Lucida Sans Unicode"][b][/b][/font][/size]
danielmohr91 Posted December 18, 2009 Author Posted December 18, 2009 Awesome! Problem solved. Thank you both so much! Both of your suggestions worked flawlessly, and my real script is up and running perfectly
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