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
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