Selecting items in the ListView Control
-
I am working on an app that allows me to enter items into a listview control, I also would like to add a image to that particular item how can I do that using the select case function? Or is there another way to do that? Also I want to be able to double click on any item in the listview control and it will display information about the selected item. I have been having trouble selecting item from the ListView control using Select Case. Can you please let me know what I am doing wrong…. Thanks :confused: Thanks cPod....
-
I am working on an app that allows me to enter items into a listview control, I also would like to add a image to that particular item how can I do that using the select case function? Or is there another way to do that? Also I want to be able to double click on any item in the listview control and it will display information about the selected item. I have been having trouble selecting item from the ListView control using Select Case. Can you please let me know what I am doing wrong…. Thanks :confused: Thanks cPod....
Hi! 1 - Concerning adding items and associating an image to them you could associate an ImageList to the smallImageList or largeImageList property of the class and then when you're creating the items do: myListView.Items.Add(New ListViewItem("blablabla", myImageIndex)) myImageIndex is the imageList index of the image you whish to show in the item. 2- To show Info about ONE selected item you have to put this code in the doubleClick event of the Listview: myListView = CType(sender,ListView) ListViewSelectedText = myListView.SelectedItems(0).Text With this you're getting the text of the item.You can also have for example some info in the tag property... ListViewSelectedTag = myListView.SelectedItems(0).Tag NOTE: If you have the multiselect property active then you'll have to iterate through the selectedItems collection and get the info you need Never say never
-
Hi! 1 - Concerning adding items and associating an image to them you could associate an ImageList to the smallImageList or largeImageList property of the class and then when you're creating the items do: myListView.Items.Add(New ListViewItem("blablabla", myImageIndex)) myImageIndex is the imageList index of the image you whish to show in the item. 2- To show Info about ONE selected item you have to put this code in the doubleClick event of the Listview: myListView = CType(sender,ListView) ListViewSelectedText = myListView.SelectedItems(0).Text With this you're getting the text of the item.You can also have for example some info in the tag property... ListViewSelectedTag = myListView.SelectedItems(0).Tag NOTE: If you have the multiselect property active then you'll have to iterate through the selectedItems collection and get the info you need Never say never
-
Is it possible to bind images from a database into a ListView Control? Thanks Thanks cPod....
Hi! I've never done that but maybe you should check out the bindingContext property. Sorry i can't give you any more help. Never say never