Muzza Posted March 29, 2007 Posted March 29, 2007 I have cheched out the other topics re alternate colours in lists but I just can't get it to work when building the list from an array. Could someone please check this code segment and point me in the right direction. Thanks, Muzza $lv_pcs = GUICtrlCreateListView("Machine|IP Address|MAC|Brand|Model|Serial|BIOS|OS|Site|DST|Brava|User", 5, 52, 1000, 462) GUICtrlSetBkColor($lv_pcs, $GUI_BKCOLOR_LV_ALTERNATE) For $x = 1 to UBound($f_srcArray) - 2 $f_ItemData = $f_srcArray[$x][1] For $e = 2 to $f_noElements - 1 $f_ItemData = $f_ItemData & " | " & $f_srcArray[$x][$e] Next _GUICtrlListViewInsertItem($f_ListToFill, -1, $f_ItemData ) GUICtrlSetBkColor(-1,0xFF00FF) Next GUISetState(@SW_SHOW)
Marc Posted March 29, 2007 Posted March 29, 2007 Hi, had the same problem - $GUI_BKCOLOR_LV_ALTERNATE does not seem to have any effect in my script. So I simply ignored it and .... if Mod($x,2) =1 Then GUICtrlSetBkColor(-1, "0x00AAFBFF")oÝ÷ Øë¡÷.®*.²+r";¬¶ÚâyØj¢Ø^ªê-®(!¶«¨·²Â¥u·¢Ç¶¢Z+¡ûax¸¬¶øÂÚ*ºZ׫«^ªê-jwmç(è~Ø^.+-V'°!1¶¢Z+jëh×6$lv_pcs = GUICtrlCreateListView("Machine|IP Address|MAC|Brand|Model|Serial|BIOS|OS|Site|DST|Brava|User", 5, 52, 1000, 462) GUICtrlSetBkColor($lv_pcs, $GUI_BKCOLOR_LV_ALTERNATE) For $x = 1 to UBound($f_srcArray) - 2 $f_ItemData = $f_srcArray[$x][1] For $e = 2 to $f_noElements - 1 $f_ItemData = $f_ItemData & " | " & $f_srcArray[$x][$e] Next $x= _GUICtrlListViewInsertItem($f_ListToFill, -1, $f_ItemData ) GUICtrlSetBkColor($x,0xFF00FF) Next GUISetState(@SW_SHOW) best regards, Marc Any of my own codes posted on the forum are free for use by others without any restriction of any kind. (WTFPL)
xcal Posted March 29, 2007 Posted March 29, 2007 #include <GUIConstants.au3> GUICreate('', 110, 330) $lv = GUICtrlCreateListView('some column', 10, 10, 90, 310) GUICtrlSetBkColor($lv, 0xFFFFFF) GUICtrlSetBkColor($lv, $GUI_BKCOLOR_LV_ALTERNATE) For $i = 1 To 20 GUICtrlCreateListViewItem('item ' & $i, $lv) GUICtrlSetBkColor(-1, 0xEEEEEE) Next GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd How To Ask Questions The Smart Way
Muzza Posted March 29, 2007 Author Posted March 29, 2007 Hi Marc, Tried your variation and it still did not colour? Any other ideas? Muzza
xcal Posted March 29, 2007 Posted March 29, 2007 Oh! I have an idea! Try mine? How To Ask Questions The Smart Way
Muzza Posted March 29, 2007 Author Posted March 29, 2007 Hi xcal, Tried your method and all I get is a blank screen, no table data? I am sure i am missing something realy stupid... thanks, Muzza
xcal Posted March 29, 2007 Posted March 29, 2007 (edited) Then there's (likely) a mistake in your script, and you should probably post it, unless you can fix it on your own. Edited March 29, 2007 by xcal How To Ask Questions The Smart Way
Muzza Posted March 29, 2007 Author Posted March 29, 2007 Yes, there was a mistake in my script. I cut it back to bare bones and your solution xcal worked. thanks heaps for the help guys, Muzza
DjDeep00 Posted June 5, 2007 Posted June 5, 2007 #include <GUIConstants.au3> GUICreate('', 110, 330) $lv = GUICtrlCreateListView('some column', 10, 10, 90, 310) GUICtrlSetBkColor($lv, 0xFFFFFF) GUICtrlSetBkColor($lv, $GUI_BKCOLOR_LV_ALTERNATE) For $i = 1 To 20 GUICtrlCreateListViewItem('item ' & $i, $lv) GUICtrlSetBkColor(-1, 0xEEEEEE) Next GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd XCAL, I was wondering what I need to do to have the same effect of the alternate line color in listview with an older version of the beta? Thanks.
DjDeep00 Posted June 7, 2007 Posted June 7, 2007 XCAL,I was wondering what I need to do to have the same effect of the alternate line color in listview with an older version of the beta?Thanks.XCAL? Can anyone else help me with this please?
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