How can I make my own listBox control? I want to make a listBox control and add unlimited items to it.
Printable View
How can I make my own listBox control? I want to make a listBox control and add unlimited items to it.
Hey..
when you start the new project select
ActiveXControl ,
Draw list box, add code ,
Is this you want,
or what else??
Gary
Unfortunatly champgary suggestion would have the same constraints and limits that the standard Listbox would have.
One would need to use the API within the activeX control in order to user draw the listbox, as well as holding the entries in a structure that could cope with an unlimited number of items.
Not a trivial task but certainly not impossible. In fact it would be a nice little project for learning about ActiveX controls and the API. It could also be a useful addition to the standard control set, especially if additional functionality was added.
Heres the API code to create a Listbox, Buttons, a status bar, textbox and a form...Hope this helps.
WOka
For anyone who wants to create their own ActiveX control, VB World has a great
tutorial for people who have never done this before:
http://www.vb-world.net/activex/controls/
thanks Wokawidget. But that's gunna take a while to get it down to just the list box out of that code.
But... no matter what approach he uses. he'll have to put the items of the listbox in an array (or collection) and everyone knows that array or collection use indexes which are of type Integer.. .so would it be possible to store unlimited items?? as the integer limit isn +ve is 32767..
What do you ppl think????
There is always going to be some limit, even if it is just physical RAM. But it should be possible to dynamically create additional arrays/collections as the dataset grows - but this would need some hefty code to manage.
The INDEX of a collection is a long...
That means you can store up to 2 billion entries :D
Is that enough, or is that limited? :)
2 billion is good :D