Vykaendys Posted January 15, 2014 Posted January 15, 2014 Greetings, I'm experiencing a strange issue with the background colour in a ListView control when it's in a tab. If another window opens (this is one of the functions my app will be doing), the background of the tab overrides the background colour of the empty listview area. I tried setting the listview control to $GUI_ONTOP, but that doesn't seem to help. The only way I've figured out to get around it is to reset the background colour of the listview control to force it to redraw. Obviously, this doesn't look too great. Does anyone have any ideas? This is just sample code, but reproduces the error consistently for me. #include <GUIConstants.au3> #include <GuiListView.au3> $gui = GUICreate("Test", 300, 300) $button1 = GUICtrlCreateButton("Open Folder", 5, 275, 80, 20) $button2 = GUICtrlCreateButton("Exit", 215, 275, 80, 20) $tab = GUICtrlCreateTab(5, 5, 290, 200) $tab1 = GUICtrlCreateTabItem("Tab 1") $listview = GUICtrlCreateListView("Column 1|Column 2", 20, 50, 260, 150) GUICtrlSetBkColor($listview, 0xAAAAAA) For $i = 0 To 5 _GUICtrlListView_AddItem($listview, "Item " & $i) _GUICtrlListView_AddSubItem($listview, $i, "Subitem " & $i, 1) Next $tab2 = GUICtrlCreateTabItem("Tab 2") GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE, $button2 Exit Case $button1 Run('explorer.exe "' & @UserProfileDir) Case Else ;;; EndSwitch WEnd Thanks!
SupaNewb Posted January 16, 2014 Posted January 16, 2014 I could not reproduce the error you described on a Win 7 x86 box with your posted code. However, I have had the problem you described when I had overlapping controls. I am curious to know if my code below produces your error. #Include <GUIConstantsEx.au3> $gui = GUICreate("Test", 300, 300) ;GUISetBkColor(0xE2E2C7); remove comment to show tab region $button1 = GUICtrlCreateButton("Open Folder", 5, 275, 80, 20) $button2 = GUICtrlCreateButton("Exit", 215, 275, 80, 20) $tab = GUICtrlCreateTab(5, 5, 290, 200) $tab1 = GUICtrlCreateTabItem("Tab 1") $listview = GUICtrlCreateListView("Column 1|Column 2", 20, 50, 260, 150) GUICtrlSetBkColor($listview, 0xAAAAAA) $tab2 = GUICtrlCreateTabItem("Tab 2") GUICtrlCreateTabItem(""); end tabitem definition For $i = 0 To 5 GUICtrlCreateListViewItem("Item " & $i & "|SubItem " & $i,$listview) Next GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE, $button2 Exit Case $button1 Run('explorer.exe "' & @UserProfileDir) Case Else ;;; EndSwitch WEnd
Moderators Melba23 Posted January 16, 2014 Moderators Posted January 16, 2014 Hi,Both of those scripts reproduce the error for me. It seems that resetting the back colour of the ListView after a short pause (~250ms) resets the GUI, but I cannot for the moment stop the initial problem. 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
Vykaendys Posted January 16, 2014 Author Posted January 16, 2014 SupaNewb, your code does reproduce it for me. I currently have my script resetting the background colour after a short pause, but it makes it look really horrible, and I had to add a timer to occasionally reset the background colour constantly, in case some other process causes the problem.
SupaNewb Posted January 16, 2014 Posted January 16, 2014 Could it be a version thing? I am using Autoit v3.3.8.1 (non beta).
Moderators Melba23 Posted January 16, 2014 Moderators Posted January 16, 2014 SupaNewb,No, I am running 3.3.10.2 and 3.3.11.3. 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
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