Hi i have a listview control on form1. I want to send the selected value to form2.
I tried couple of ways but nothing seems to work correctly.
I don't have VB.NET installed at the moment. Anyway, try this:
Change the Modifiers property for the listview to "public" and then try to access it from form2 like this:
Form1.listView1 An example for selecting the current selected item:
Dim selectedItem as ListViewItem = Form1.listView1.SelectedItems
Thanks for replying. I just tried. its not workking. I am getting the following error:
Oh Sorry. Its a "( )" instead of "[ ]".
Dim selectedItem as ListViewItem = Form1.listView1.SelectedItems[B]([/B]0[B])[/B]
so it gets the item selected and saves it as a listviewitem?
is there a way to cast it to a string?
Do you want to get its value?
If so then use this:
Dim listViewValue as String = Form1.listView1.SelectedItems(0).Text
thank you so much :)