Results 1 to 2 of 2

Thread: Passing value to class By Reference

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2002
    Location
    India
    Posts
    1

    Question Passing value to class By Reference

    How can i pass values, by reference, say a list box in my main form, to my class routine. I want to create a class that searches for an item in a list box and returns True if found else false.
    Please Help me on this

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898
    vb6 although it will not complain if in your class you do

    public sub returnlist(byref objListBox as ListBox)

    it will not work.

    In your class Do:

    public sub returnlist(byref objListBox as object)

    then code with the assumption that objlistbox has all the properties/methods of a listbox, this will work.

    You can leave the declaration as listbox while coding this will give you the context sensative help, but remember to set it back to object before you run.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width