DrPickles Posted December 20, 2021 Posted December 20, 2021 I have taken a working example of a 1d GUICtrlCreateListView and tried to make it a 2d. I have looked at the GUIListViewEx.au3 and _GUIListViewEx.au3 example "GLVEx_Example_6.au3" and i am having a hard time separating out all the functions. if some one can give me an example where i can target cells using array style coordinates "backgound_color($listApps, 0,1)' or some such, that would be much appreciated. single cell 2d highlight or text color.au3Fetching info...
DrPickles Posted December 20, 2021 Author Posted December 20, 2021 (edited) expandcollapse popup#include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <Array.au3> #include "GUIListViewEx.au3" Global $aColArray[70][1] $hGUI = GUICreate("Test", 500, 500) $listApps = GUICtrlCreateListView("Items|test", 10, 10, 400, 400, $LVS_SHOWSELALWAYS) For $i = 0 To 69 GUICtrlCreateListViewItem("Item " & $i & "|test " & $i, $listApps) If StringinStr($i, "7") Then $aColArray[$i][0] = "0xFF0000;" Else $aColArray[$i][0] = ";" EndIf Next $arrayList = _GUIListViewEx_ReadToArray($listApps) _ArrayDisplay($arrayList, "Items", Default) _ArrayDisplay($aColArray, "Colours", Default) $lvIndex = _GUIListViewEx_Init($listApps, $arrayList, "", "", "", 32) _GUIListViewEx_LoadColour($lvIndex, $aColArray) _GUIListViewEx_MsgRegister() GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited December 20, 2021 by Melba23 Added code tags
Moderators Melba23 Posted December 20, 2021 Moderators Posted December 20, 2021 DrPickles, If you check the return from the _GUIListViewEx_LoadColour function you will see that it gives you 0 with @error set to 3 and @extended to 1. According to the function header this means: Array not correct size for LV. Basically you have a ListView with 2 columns, but a colour array with only one - so change this line and all will be well: Global $aColArray[70][2] M23 P.S. When you post code in future please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. Thanks in advance for your cooperation. 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: Reveal hidden contents 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
DrPickles Posted December 21, 2021 Author Posted December 21, 2021 this did the trick! I used Ubound to get the size of the GUICtrlCreateListView so the $aColArray has the correct sizing. then targeted using $aColArray[x][Y].
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