Hello. I have a Listbox, listBoxA (say), on FormA. Now, there are two other Forms, FormB and FormC, with textboxes textBoxB and textBoxC.
The items in listBoxA are added to via textBoxB and textBoxC; either textbox can add an item. Can this be done? How can this be done?
Here's what I could come up with: Write item from either textbox to a textfile and read the items from the textfile for the listbox. It works but if FormA (with the listbox) is open, I must close it and re-open to see new item(s).
Anyone know of a better way, especially where I don't have to re-open the Form with the listbox? This is in C#. Thanks!
I would create a public method in FormA (AddListItems) that adds item(s) to listBoxA, then call the procedure from forms B & C. In order to do this, forms B & C must have a reference to FormA. If B & C are opened from A, you can pass FormA as a parameter to a public Open or Show method in forms B & C.
Bookmarks