|
-
January 25th, 2000, 12:53 PM
#1
List Box AddItem Method
hopefully this will be a quick (easy question)
ok my list box is sorted so when i add an item via AddItem i want to know what index it added it to because i need to set the ItemData for that new index i just added
i thought i coulde do the following..
dim newIdx as integer
newIdx = list.AddItem "Text"
list.ItemData( newIdx ) = ID
any suggestions as to how i can do something like the code above?
thankx,
-
January 25th, 2000, 01:39 PM
#2
Re: List Box AddItem Method
You can get the index oof the most recently added item in a listbox by getting the property NewIndex of the list control, for example:
dim myIndx as long
List1.Clear
List1.AddItem "ABC"
List1.AddItem "ZXY"
List1.AddItem "EFG"
myIndx = list1.NewIndex
' myIndx contains the index number of EFG wich is 2
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
|