Click to See Complete Forum and Search --> : How to add items to listboxs from textboxs?


CCDriver
March 13th, 2001, 03:26 AM
Hi All

I was wondering if someone could help?

How do you add a number of items to a listbox from textbox's. I have three textboxs: FirstName, LastName and Age. I want to add the data i type in these boxs to appear in the listbox when i click an add button which has three columns in it. The listbox is for viewing only and it will of course have many row's in it after awhile, and i want to be able to select a row and that data appear back in the textboxs so i can edit them.

I also want to be able to delete a row when it's not needed anymore, i think this last one can be done by "removing.item" from what i have read so far. But the other bit is more difficult to find an example for.

Can anyone help?
Thanks.

CK Dixon
March 13th, 2001, 06:25 AM
The list box is not for you. Use the MSFlexGrid control. You can add it from Project|Components

CCDriver
March 14th, 2001, 05:51 AM
Thanks CK, i've looked at the msflexgrid and come across a sample but from what i can make out, the number of rows is defined whereas the one i want will vary, one group may have 2 rows in it another might have 20 or more.
Plus i wanted to select an item to appear back in the textbox's to make it neat and tidy to work with one item at a time, this might still work though with the msflexgrid. ( i suppose the flexgrid alows you to edit it directly, doe's it? )
I'd still prefer the listview and textbox's as it looks better than the flexgrid.

I could make use of this elsewhere though, thanks for that.