|
-
Feb 16th, 2001, 09:30 AM
#1
Thread Starter
Frenzied Member
I asked this half an hour ago, but I then deleted it as I thought I had found the answer at :
http://www.vbsquare.com/tips/tip289.html
But it doesn't quite give me what I want.....
I have a listbox with a list of files in it.
I need to add the icon of the file into the front of the list box. The icon being based on the file type, e.g. .DOC, .XLS, .MSG, .TXT, .EXE etc.
The code referenced above adds the icon into a picture box - but I can't do a ListBox.AddItem to get it into the listbox.
Thanks for any help,
Chris
-
Feb 16th, 2001, 09:41 AM
#2
Retired VBF Adm1nistrator
Use a ListView.
Looks nearly the same, but allows you to add icons.
- jamie
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Feb 16th, 2001, 10:26 AM
#3
Fanatic Member
Brad Martinez is a bit of a god at this sort of thing, as plenderj said, best to use a listview, the next thing is to work out how to take the default icons of the files you want and add them to imagelist - one answer is to use the windows system imagelist, heres some example code (fairly complex)
http://www.mvps.org/btmtz/listview/systemimagelist.zip
hope this helps
Crispin
VB6 ENT SP5
VB.NET
W2K ADV SVR SP3
WWW.BLOCKSOFT.CO.UK
[Microsoft Basic: 1976-2001, RIP]
-
Feb 16th, 2001, 11:45 AM
#4
Thread Starter
Frenzied Member
Thanks Jamie....
That pointer and this information:
http://www.mvps.org/vbnet/index.html
seems to have solved it for me.
Cheers, Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|