#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    8
    Rep Power
    0

    Execution to another form


    I have two forms to my program right now. I have a command on my first form that opens up the second form and is "supposed" to load a txt file into a listbox. But the command still wants to load that txt file on my first form and not my second. How do I make it so the command notifies that my listbox is in another form?
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    5
    Rep Power
    0
    Hi,

    When you load the Form2, you can put LoadTxt function to load the string to Form1.ListBox.

    ----Form2
    sub Form2_load

    Form1.List1.AddItem("Hello")
    Form1.List1.AddItem("Welcome")

    End sub

    For the Visual Basic, when you want to call other object form's subobject or function, you just call like this:
    Object.Subobject.Method()

    So, you call Form2's object or method from Form1. also you can call form1's object or method from Form2.

    you can go to the MSDN Library or Microsoft wb site Online MSDN to the detail info.

    Hope it helps.

    Jim Guo
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    8
    Rep Power
    0
    Yeah, I'll try it out. I appreciate it.

IMN logo majestic logo threadwatch logo seochat tools logo