Results 1 to 6 of 6

Thread: Listbox OCX Help

  1. #1

    Thread Starter
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336

    Listbox OCX Help

    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?
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  2. #2
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    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...
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  3. #3

    Thread Starter
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    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.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  4. #4
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    So how are you making a listbox then???

    Where is the list???
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  5. #5

    Thread Starter
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    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.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  6. #6
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    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.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width