Results 1 to 2 of 2

Thread: Pass Listbox to a function

  1. #1

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Pass Listbox to a function

    I have developed a function in a class which takes argument of type ListControl. Now, from my form, I need to pass the reference of my listbox to the function and the function will then add items to listbox. How do I pass the reference of the listbox or combobox to the function.

    The signature of the method is this :

    public void Fill(ref ListControl thisList)

    Thanks

  2. #2
    Banned jhermiz's Avatar
    Join Date
    Jun 2002
    Location
    Antarctica
    Posts
    2,492

    Re: Pass Listbox to a function

    Quote Originally Posted by usamaalam
    I have developed a function in a class which takes argument of type ListControl. Now, from my form, I need to pass the reference of my listbox to the function and the function will then add items to listbox. How do I pass the reference of the listbox or combobox to the function.

    The signature of the method is this :

    public void Fill(ref ListControl thisList)

    Thanks
    Just pass the entire listbox.

    Then in the procedure you do:

    void foo(ref Listbox x)
    ....

    Jon

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