I am using a listbox to display the directory of a remote computer using ftp. I am able to determine which files are subdirectories and which ones aren't by the "/" at the end of the file name. I would like to place an image of a folder beside each name in the list that designates a directory or subdirectory. I am not aware of any way to add an image to a listbox or of a control that does allow for a list of images and text combined.
Is there a method to add an image to a listbox or a control that will allow a list of text and images?
I have never used either of those controls before. I loaded them, added them to a form to play with them to understand them and like many of microsofts newer controls there isn't much documentation for them, not on using them anyway. As with some of the others I feel sure that in time on this board and others I will get them figured out one day.
Any helpful hints would sure be appreciated. As of now I am trying to understand how to add items to the list, both pictures and text.
Both of those controls are nice, either would work but not exactly what I am looking for. Cute FTP uses what appears to be a standard list with folder icons added to it. This is what I am looking for to use in this current project. Using listview would make a nice FTP program, especially if files and folders could be dragged and dropped to and from a remote location. This would work best with plenty of screen space to use. I am adding some FTP functions to some existing software and do not have that much real estate to use for the ftp functions so it is starting to appear that a standard list box will be needed.
In VB6 it requires subclassing and owner drawing the control. It is complex code, often requiring a subclassing control, that is more trouble than it is worth in terms of development time and complexity plus it makes the final product less stable. I don't recommend doing this unless you're coding for your own enjoyment. You should be able to find some examples at some of the source code repository sites, like CodeGuru or Planet Source Code, but you will find that you need to modify them a lot.
I still think your best bet is to use Treeview if you need a small footprint, listbox like, widget. It's really not that hard to use and it's rather flexible.
There were some third party products around in the late 90's/early 00's that provided extended listbox functionality as well. I don't know what the current availability of these would be though.
Listview would work nice if I could set it to look like a standard list with icons. I noticed a setting to make it look like a standard listbox but the icons seem to disappear when I do this. I seem to only be able to use icons when listview looks like the right side of Windows Explorer. Perhaps I am doing something wrong.
Is there a way to set listview to look like a standard list and show icons?
I think ListView will work. I must have done something wrong earlier. If I set ListView1.View to lvwList it seems to work fine. I can add a folder beside all directories and no icon beside all of the others. This is exactly what I want. Perhaps in the future I might even add more icons to use for text files, image files etc.
All I need now is to figure out how to make all of the files line up in a single list on the left side.