Talk2Tom11 Posted August 8, 2005 Posted August 8, 2005 I was wondering if someone could help me out with being able to double click an item in a listview, and then have that item appear in a textbox. What is in the listview is just strings from a database. Quote
jmcilhinney Posted August 8, 2005 Posted August 8, 2005 In the DoubleClick event handler use the SelectedIndices or SelectedItems property of the ListView to get the item that was double-clicked and read the Text property of each Subitem. Quote
Talk2Tom11 Posted August 8, 2005 Author Posted August 8, 2005 In the DoubleClick event handler use the SelectedIndices or SelectedItems property of the ListView to get the item that was double-clicked and read the Text property of each Subitem. Private Sub ListView2_ItemActivate(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView2.ItemActivate TextBox1.Text = ListView2.SelectedItems End Sub that is the code I have as of now. What would I add to selecteditems? Quote
jmcilhinney Posted August 8, 2005 Posted August 8, 2005 Like I said, use the SelectedItems property to get the item that was activated. If you look up the SelectedItems property in the help you'll see it's type and you'll be able to get a single item from it. Once you have a ListViewItem, as I said before, you need to read the Text property of each SubItem. Quote
Talk2Tom11 Posted August 8, 2005 Author Posted August 8, 2005 I am sorry but i am alittle confused... could you explain in code for me? Quote
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.