Advertisement

07.07.2008 at 11:29AM PDT, ID: 23544291
[x]
Attachment Details

Retrieving ListView Selection in VB.net

Asked by EGormly in Microsoft Visual Basic.Net, Visual Studio .NET 2005

Visual Studio 2005
Visual Basic.net
Windows Application

I need to simply return a selected item text value in a listview to a textbox when an item is clicked.
I am populating the ListView with a simple file collection.

The following code works ONCE,. then when I click on another item in the listview, I get an index error.

Code:
TextBox1.Text = ListView1.SelectedItems(0).ToString

Error is:
"InvalidArgument=Value of '0' is not valid for 'index'. Parameter name: index"


I would also like to loop through multiple selections but first need to return one...Start Free Trial
[+][-]07.07.2008 at 12:03PM PDT, ID: 21947657

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, Visual Studio .NET 2005
Sign Up Now!
Solution Provided By: Focusyn
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628