|
-
October 19th, 1999, 01:22 AM
#1
Need help replacing an item in a listbox
I am really new at this...
I can not replace an item inside of a listbox with another item. It ony ends up going to the bottom. I'm sure it's probably pretty easy so any help would be great. Thanks
-
October 19th, 1999, 01:43 AM
#2
Re: Need help replacing an item in a listbox
GoTo http://www.freevbcode.com/ShowCode.Asp?ID=313. This is a function that allows you to find a string in a list box or combo box. Paste the code into your project. Then, use the function (called FindStringinListControl) as follows:
Dim lIndex as Long
lIndex = FindStringinListControl(List1, "SearchText")
If lIndex <> -1 then
List1.RemoveItem lIndex
List1.AddItem "Replacement Text", lIndex
End If
-
October 19th, 1999, 04:26 AM
#3
Re: Need help replacing an item in a listbox
I forgot to mention that I wouldn't know what to search for as this is user submitted text.. I need to know how to replace it using a line number..
-
October 19th, 1999, 07:09 AM
#4
Re: Need help replacing an item in a listbox
Just say
Listbox.List(i) = "new string", where i is the 0-based (line)item no of the list box item. Wont this help?
RK
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
|