![]() ![]() ![]() VB6: Debug.Print ListView1.ListItems(0).SubItem(0).Text Debug.Print ListView1.ListItems(0).SubItem(2).Text If you are using Visual Basic 2005, then you need to change your code since the new control has an Items collection, not a ListItems collection. So if you have 3 columns, they should be indexed 0-2. ![]() Robin, Are you using VB6 and the Listview control from that? If memory serves me correctly, the listitems and subitems are 0 based collections. Hi Zafir I was wondering if you can post a demo project or the source code for this. But after edit subitem memory leak occurred. Thanks for helping make community forums a great place. ![]() Best regards, Youjun Tang We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. E.DrawFocusRectangle(Me.ListView1.Items(e.ItemIndex).SubItems(e.ColumnIndex).Bounds) Else e.DrawText() End If End Sub Private Sub ListView1_DrawColumnHeader(sender As Object, e As DrawListViewColumnHeaderEventArgs) Handles ListView1.DrawColumnHeader e.DrawText() End Sub If you have any other concern regarding this issue, please feel free to let me know. Private Sub ListView1_DrawSubItem(sender As Object, e As DrawListViewSubItemEventArgs) Handles ListView1.DrawSubItem If e.ColumnIndex = 2 Then Dim im As Image = Image.FromFile('YOUR IMAGE PATH') Dim location As Point = Me.listView1.Items(e.ItemIndex).SubItems(e.ColumnIndex).Bounds.Location e.Graphics.DrawImage(im, Location) e.Graphics.DrawString('hi', Me.Font, new SolidBrush(Color.Black), new PointF(location.X + 20, location.Y)) 'Here 20 is the width of your image. Then use the and event handler to redraw the item. First you should change the OwnDraw property of the ListView to True. I suggest you redrawing the Item of ListView. Hi TeachMe, According to your description, you'd like to add a Image next to the string in the listview item. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |