rony2006 Posted May 8, 2016 Posted May 8, 2016 Hello, I have a list view were I set the data using: _GUICtrlListView_AddArray($lista, $aOk) How I can now get that data and put it in a 2d array? I cannot use $aOk because this I use multiple _GUICtrlListView_AddArray with multiple 2d arrays like $aOk
InunoTaishou Posted May 8, 2016 Posted May 8, 2016 https://www.autoitscript.com/autoit3/docs/libfunctions/_GUICtrlListView_GetItem.htm Or https://www.autoitscript.com/autoit3/docs/libfunctions/_GUICtrlListView_GetItemText.htm And build your own array.
Moderators Melba23 Posted May 8, 2016 Moderators Posted May 8, 2016 rony2006 The _GUIListViewEx_ReadToArray function in my GUIListViewEx UDF (look in my sig for the link) will do that for you. 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
rony2006 Posted May 8, 2016 Author Posted May 8, 2016 I tried _GUICtrlListView_GetItemText but seams to hard to build my array because my listview can get very big. Now I try what Melba23 sugested
rony2006 Posted May 8, 2016 Author Posted May 8, 2016 (edited) @Melba23 Thank you! Is working perfect. I wanted to take the data from listview and put in a Excel. I used the following code: Create application object Local $oAppl = _Excel_Open() If @error Then Exit MsgBox(16, "Excel UDF: _Excel_BookOpen Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; ***************************************************************************** ; Open an existing workbook and return its object identifier. ; ***************************************************************************** Local $sWorkbook = @ScriptDir & "\res\Excel.xlsx" Local $oWorkbook = _Excel_BookOpen($oAppl, $sWorkbook, Default, Default, True) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookOpen Example 1", "Error opening '" & $sWorkbook & "'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) ; ***************************************************************************** ; Write a part of a 2D array to the active sheet in the active workbook ; ***************************************************************************** $lt = _GUIListViewEx_ReadToArray($listatickete, 0) ;_ArrayDisplay($lt, "1D display") _Excel_RangeWrite($oWorkbook, $oWorkbook.Activesheet, $lt, "B5") Using you udf is possible to replace some text from listview with text + background color? or icon? Edited May 8, 2016 by rony2006
Moderators Melba23 Posted May 9, 2016 Moderators Posted May 9, 2016 rony2006. Quote Using you udf is possible to replace some text from listview with text + background color? or icon? The function I mentioned above is stand-alone, but if you use the full UDF and initialise your ListView it does allow you to use colour for each cell and then _GUIListViewEx_ReturnArray will return you the text or colour of the content depending on the value of the $iMode parameter. I am afraid that there is no icon functionality in the UDF - it is complicated enough already! 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