Strydr Posted March 14, 2019 Share Posted March 14, 2019 I've got a project that I've been working on for a while and I've been creating Listviews and imagelists just fine. Now I'm attempting to "update" my code and things aren't working as I'd expect. I've been creating the Listview with GUICtrlCreateListView and then populating it using _GUICtrlListView_AddSubItem. Now I'm attempting to use GUICtrlCreateListViewItem to populate it and while the commands work, my icons no longer show up and I can't figure out why. Any ideas? The program is way too long to post, but I'll list what I'm using that works and what I'm attempting to use that doesn't. And I'll probably forget to add the info needed to help me. I'm good at that... Quote These lines: _GUICtrlListView_AddItem($ListView_Temp, "", $RowNB) _GUICtrlListView_AddSubItem($ListView_Temp, $RowNB, $AppId, 1) _GUICtrlListView_AddSubItem($ListView_Temp, $RowNB, $Name, 2) _GUICtrlListView_AddSubItem($ListView_Temp, $RowNB, $InstallDrive, 3) _GUICtrlListView_AddSubItem($ListView_Temp, $RowNB, $SoD, 4) are replaced by this line: GUICtrlCreateListViewItem("|" & $AppId & "|" & $Name & "|" & $InstallDrive & "|" & $SoD, $ListView_Temp) The spacing seems the same, including the first field, but the icons simply no longer show up! Hep? Thanks! Link to comment Share on other sites More sharing options...
Nine Posted March 14, 2019 Share Posted March 14, 2019 When I see someone asking for help and doesn't make the effort of making it understandable, I truly fell bad for you. In any case, if you want some help (from me at least) I strongly suggest you make a runable script that we can use. FrancescoDiMuro 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Strydr Posted March 14, 2019 Author Share Posted March 14, 2019 Wow! Ok, I'm just a lazy asshole. Thank you for your help. I was hoping to find someone who knows enough about using listviews to be able to tell me the practical difference in the two commands. There's obviously a difference in how and when each command should be used but I can't find any documentation that discusses the differences. Has anyone mentioned that a lot of the people on this forum are just mean? I'm obviously asking for help in the wrong place, thank you anyways. Link to comment Share on other sites More sharing options...
BrewManNH Posted March 14, 2019 Share Posted March 14, 2019 Instead of losing your mind, how about just posting a script that demonstrates the issue you're having? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
LarsJ Posted March 15, 2019 Share Posted March 15, 2019 There is really no need for code to answer such a question. The reason it doesn't work with GUICtrlCreateListViewItem is that this built-in command doesn't support item icons. Perhaps you can specify a single icon using GUICtrlSetImage but it's not worth the trouble. If you want icons in your listview then you should use the functions in the UDF. The purpose of all the built-in GUICtrlCreate-commands is to make it easy and quick to get started for a new AutoIt coder. On the other hand, they all have quite limited functionality. If you want more functionality, use the UDF functions. pixelsearch 1 Controls, File Explorer, ROT objects, UI Automation, Windows Message MonitorCompiled code: Accessing AutoIt variables, DotNet.au3 UDF, Using C# and VB codeShell menus: The Context menu, The Favorites menu. Shell related: Control Panel, System Image ListsGraphics related: Rubik's Cube, OpenGL without external libraries, Navigating in an image, Non-rectangular selectionsListView controls: Colors and fonts, Multi-line header, Multi-line items, Checkboxes and icons, Incremental searchListView controls: Virtual ListViews, Editing cells, Data display functions Link to comment Share on other sites More sharing options...
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