Jump to content

My LIstview icons work using _GUICtrlListView_AddSubItem but not if I use GUICtrlCreateListViewItem. What's going on?


Recommended Posts

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

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.

Link to comment
Share on other sites

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

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 Gude
How 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

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...