I am trying to create a listbox ocx. I have everything down except for how to create the .List .Listindex .Index functions. Can anyone fill me in on how to create these functions?
Printable View
I am trying to create a listbox ocx. I have everything down except for how to create the .List .Listindex .Index functions. Can anyone fill me in on how to create these functions?
Not without knowing how you designed you listbox.
If you used an array as the storage for the listbox, then
.List(i)would be Array(i).
.ListIndex would be i
.Index is not something you need to create yourself, it's a project thing to reference a control array. You just need to set the control to MultiUse or something - I forget what the setting is...
Hi, thanks. I havent used anything for the storage of the listbox. How do i set that up?
Right now the listbox adds things like this.
Sub Additem(Item As String)
UserControl.Print Item
End Sub
AS far as keeping the items in an array i dont know how to impliment that.
So how are you making a listbox then???
Where is the list???
The list is printed on the Usercontrol using the print command.
My whole point of this thread was how do i keep track of the list using Listindex ect.... If i knew how to do that i wouldnt have written the post.
And I told you, I really don't know how you're making a list.
What does it do? Just print a line onto a box?
I really think you need to use an array to store the data in the list.
Or else you can't have a .ListIndex or a .List. You just have alot of text. Which you could reference by it's location on the control, I guess, but that's a bit silly, and wouldn't work very well for a big list.