Set Object Refrence From String?

J

John Rugo

Hi All,

I would like to know how to set an object from a string provided?

Here is the situation:
I have a listview that holds the names of ListView Objects on different
forms. I want to set an object called frmOBJ As Object to the Listview sub
Item holding the name of the form and listview to access.

LV is the listview holding the names of the ListViews and their Form Names
for instance:
lv.item(1).Text = "List1"
lv.Item(1).subitems(1).text = "Form1.ListView1"
etc....

Dim lvItem as ListViewItem
For Each lvItem in LV.Items
'use this listview for something
frmOBJ = lvItem.SubItems(1).Text
Next

Any help would be appreciated,
John.
 
C

Chad Z. Hower aka Kudzu

John Rugo said:
Here is the situation:
I have a listview that holds the names of ListView Objects on
different forms. I want to set an object called frmOBJ As Object to
the Listview sub Item holding the name of the form and listview to
access.

Add the object itself instead of the string, and .NET will use the ToString method to display it.

Then you have the object reference...


--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"

Develop ASP.NET applications easier and in less time:
http://www.atozed.com/IntraWeb/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top