J
Jan Warning
How can i refresh the contents of a listbox.
On my form I have a listbox.
In the Form_load sub I coded:
listbox.datasource = A (where A is a collection that is populated from a
diskfile at program start)
listbox.displaymember = "Naam"
When the form is displayed the listbox shows the items in the collection.
So far no problem.
Now I add an item to the collection A and want that to show up in my
listbox.
When I do a A.Items.Add() I get a runtime error message "Cannot modify the
Items collection when the DataSource property is set."
When i change the DataSource property to Nothing and than do the Items.Add I
get an empty listbox. What am I doing wrong?
On my form I have a listbox.
In the Form_load sub I coded:
listbox.datasource = A (where A is a collection that is populated from a
diskfile at program start)
listbox.displaymember = "Naam"
When the form is displayed the listbox shows the items in the collection.
So far no problem.
Now I add an item to the collection A and want that to show up in my
listbox.
When I do a A.Items.Add() I get a runtime error message "Cannot modify the
Items collection when the DataSource property is set."
When i change the DataSource property to Nothing and than do the Items.Add I
get an empty listbox. What am I doing wrong?