Leaders dynamic_sysop Posted May 1, 2003 Leaders Posted May 1, 2003 hi , has anyone got a way of adding images to a listview subitem? over the months i've grown to like vb.net over vb6 in many ways, but i think that the listview seems a retrograde step:-\ , when i make an irc client in vb6 i can add an unconverted nickname to the main list ( leaving the "." or "@" for a host or owner as this keeps them at the top of the list ) then i add the converted name ( minus the "." or "@" ) with the corisponding icon for a host or owner next to it [ this is added as a subitem ] i set the first list to 0 wide so it's hidden and then fullrow select to On. this allows me to show hosts etc kept at the top without all the messy dots and @ signs..... now vb.net arrrrrrrrrrrgh, it wont allow me to add images to the subitems, so i'm stuck with the dot's and @ signs ( unless i set the first row to 17 wide to show an icon and then the second row as the main row ( but this looks messy because of the gap between the icons and text ) is there any way at all to add the icons or if it's not possible to hide the first char ( eg: the "." or "@" ) from view in the first row? any help would be appreciated ty.:) Quote
Guest Deleted member 22320 Posted May 21, 2003 Posted May 21, 2003 I thin you would need to either owner draw your listview, or look around for someone else who already did it. I've seen a few owner drawn listviews out there, but most of them are just mocked up to work like a datagrid. Quote
*Gurus* divil Posted May 22, 2003 *Gurus* Posted May 22, 2003 Am I missing something? I don't remember VB6 listviews being able to show icons in subitems either. ListViews in .NET can have custom sorters associated with them to compare two values, as I recall. Take a peek at the ListViewItemSorter property. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Leaders dynamic_sysop Posted May 22, 2003 Author Leaders Posted May 22, 2003 i know we dont show vb6 code on here but just to show how straightforwards it is / was in vb6 to add subitem icons... If Len(SName) > 1 Then Set strItem = frmClient.lvwYou.ListItems.Add(, SName, SName & " " & UnConverted, , ReturnIcon)'// this is the normal icon strItem.ListSubItems.Add , , strNick, ProfIcon'// this is the subitem icon ProfIcon = 0 End If you can set the first column to 0 width so it doesnt show , then you only see the subitem row eg: row 1 --------------- row2 (icon) @Dynamic (icon) Dynamic with ^^ set to 0 it'd show as this... row2 (icon) Dynamic and stay sorted according to row1:) Quote
*Gurus* divil Posted May 22, 2003 *Gurus* Posted May 22, 2003 Well I'll be damned. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.