water Posted June 19, 2015 Posted June 19, 2015 (edited) As I have been struggling a bit with the way $GUI_BKCOLOR_LV_ALTERNATE works (couldn't find an example in the help file or the forum) I post a reproducer script for future reference so you can see how it works:#include <GUIConstantsEx.au3> #include <ListViewConstants.au3> GUICreate("listview items", 220, 250, 100, 200, -1) Local $idListview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_LV_ALTERNATE) ; alternate between the listview background color and the listview item background color GUICtrlSetBkColor(-1, 0xDDEEFF) ; Set the background color for the listview Local $idItem1 = GUICtrlCreateListViewItem("item1|col12|col13", $idListview) GUICtrlSetBkColor(-1, 0xFCF6EA) ; Set the background color for the listview item Local $idItem2 = GUICtrlCreateListViewItem("item2|col22|col23", $idListview) GUICtrlSetBkColor(-1, 0xFCF6EA) ; Set the background color for the listview item Local $idItem3 = GUICtrlCreateListViewItem("item3|col32|col33", $idListview) GUICtrlSetBkColor(-1, 0xFCF6EA) ; Set the background color for the listview item Local $idItem4 = GUICtrlCreateListViewItem("item4|col42|col43", $idListview) GUICtrlSetBkColor(-1, 0xFCF6EA) ; Set the background color for the listview item Local $idItem5 = GUICtrlCreateListViewItem("item5|col52|col53", $idListview) GUICtrlSetBkColor(-1, 0xFCF6EA) ; Set the background color for the listview item GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndGives you: Edited June 19, 2015 by water Skysnake and Rockerfeller 2 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted June 19, 2015 Author Posted June 19, 2015 You can even change the color:#include <GUIConstantsEx.au3> #include <ListViewConstants.au3> GUICreate("listview items", 220, 250, 100, 200, -1) Local $idListview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_LV_ALTERNATE) ; alternate between the listview background color and the listview item background color GUICtrlSetBkColor(-1, 0xDDEEFF) ; Set the background color for the listview Local $idItem1 = GUICtrlCreateListViewItem("item1|col12|col13", $idListview) GUICtrlSetBkColor(-1, 0xFCF6EA) ; Set the background color for the listview item Local $idItem2 = GUICtrlCreateListViewItem("item2|col22|col23", $idListview) GUICtrlSetBkColor(-1, 0xFCF6EA) ; Set the background color for the listview item Local $idItem3 = GUICtrlCreateListViewItem("item3|col32|col33", $idListview) GUICtrlSetBkColor(-1, 0xFCF6EA) ; Set the background color for the listview item Local $idItem4 = GUICtrlCreateListViewItem("Now|change|color", $idListview) GUICtrlSetBkColor(-1, 0xBBF6EA) ; Set the background color for the listview item Local $idItem5 = GUICtrlCreateListViewItem("item5|col52|col53", $idListview) GUICtrlSetBkColor(-1, 0xBBF6EA) ; Set the background color for the listview item Local $idItem5 = GUICtrlCreateListViewItem("item6|col62|col63", $idListview) GUICtrlSetBkColor(-1, 0xBBF6EA) ; Set the background color for the listview item GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Skysnake 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Skysnake Posted January 4, 2016 Posted January 4, 2016 Thx Water. Skysnake Why is the snake in the sky?
water Posted January 4, 2016 Author Posted January 4, 2016 I have added an additional example to the repository. Will be available with the next beta. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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