Set Object Refrence From String?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Rugo

    #1

    Set Object Refrence From String?

    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).subi tems(1).text = "Form1.ListView 1"
    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.


  • Chad Z. Hower aka Kudzu

    #2
    Re: Set Object Refrence From String?

    "John Rugo" <jrugo@patmedia .net> wrote in
    news:ewBuh0ldFH A.3880@tk2msftn gp13.phx.gbl:[color=blue]
    > 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.[/color]

    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/
    "Programmin g is an art form that fights back"

    Develop ASP.NET applications easier and in less time:

    Comment

    Working...