Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File icons in ListView

Status
Not open for further replies.

bradles

Technical User
Sep 15, 2002
110
AU
From my previous question you would assume I'm trying to build a form with some explorer like functionality. To that end I have a ListView control filled with filenames from directories according to a patient/case previously chosen.

My users are keen to see file icons (as well as the file extensions already being displayed) to quickly differentiate the filetypes.

I have seen some VB code that operates without using ImageLists which would be ideal but it relies on APIs and control.hWnds which I haven't been able to modify to work in Access.

Any ideas?

I post the VB code and my attempts to modify for Access when I can (can't seem to find it on the web again).

Brad
 
Thanks Mark, I've had to resort to using an ImageList control as you've suggested filled with the most common file icons seen.

A bit tedious and it surprises me that there isn't a better way to display file icons.

Brad
 
it would be nice to include the path to the .ico file just the same as the setting the string text of the node. however, it's nice to use the imagelist because it stores the ico file in the control. this makes distribution easier. and... it's not actually tedious once you get it down. it only adds about 3 minutes to the building of the tree.


Mark P.

Bleh
 
Also,

Do you have any code for opening forms from nodes. i saw it somewhere.. can't find it now..


Mark P.

Bleh
 
nevermind. got it, here's a little test:

Private Sub trViewMenu_click()


Dim strItem As String

Dim trViewMenuobj As TreeView
Set trViewMenuobj = Me.trViewMenu.Object

strItem = trViewMenuobj.SelectedItem

Set trViewMenuobj = Nothing
Me.ViewForm.SetFocus

debug.print strItem
End Sub


Mark P.

Bleh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top