|
-
May 17th, 2000, 04:42 AM
#1
Thread Starter
New Member
Hello, i'm trying to insert items into a list box, but I can't seem to get it to do an insert. The additem always adds an item to the end. I tried setting the listindex and
then doing my additem, but it still adds to the bottom of the list. Here's a sample of my problem
listbox1
--------
Vehicle Type
1979 Buick cutlass
1990 Corevette Convertable
1972 Chrysler Cordoba
Property Type
Commercial
I have a prefilled listbox with vehicles and property types. I want to highlight a vehicle and click add. The vehicle should then show up on listbox2, which it does.
but if I add a vehicle, then a property type, and then
a vehicle, the list looks like:
listbox2 after user highlights and adds items from listbox1.
------------------------
Vehicle Type
1979 Buick cutlass
Land Type
Commercial
1990 Corevette Convertable - *** item, should be
under vehicle types.
how do you add items in a middle of a list.
thanks................
-
May 17th, 2000, 04:55 AM
#2
Member
Two ways
1) Set sorted property to TRUE
2) Add the item at the desired position..Check Additem method documentation
-
May 17th, 2000, 07:19 AM
#3
Code:
Private Sub Command2_Click()
i = List1.ListIndex
List1.AddItem "hhh", i
End Sub
-
May 17th, 2000, 01:05 PM
#4
Lively Member
it sounds like you would be better off using the treeview control, that is if you don't mind adding to the size of the program.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|