Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I implement 'List' functionality in a User Control?

Status
Not open for further replies.

Brucer

Programmer
Aug 18, 1999
4
US
I want to implement the same kind of List property in a user control as is found in the Listbox control from microsoft. I must be overlooking something in the doc but I can't seem to find any info on the subject. Is it possible to do this?
 
bigfoot:<br>
<br>
If you are familiar with the properties window of the Listbox control, there is a property called List which provides a dynamic dropdown box of entries which are displayed in the Listbox. I want to duplicate this 'dropdown' functionality in a user control I am creating. I don't want to use a property page for this, i want to duplicate the same capability which is in the Listbox control.<br>
<br>
The documentation says this list is just a string array, but there is no way I can find in a property to pass an array.<br>
<br>
Brucer
 
have you tried:<br>
For Rep = 1 to Ubound(StringArray)<br>
ListBox.AddItem StringArray(Rep)<br>
Next<br>
Or is this a control of your own creation? Need more data....
 
Bruce,<br>
<br>
Ok - think I understand now.<br>
<br>
Don't do it with a property - do it with a public method. That way you can duplicated the AddItem method of a standard listbox or have your own AddItems method which accepts an array as a parameter.<br>
<br>
Mike<br>
---<br>
Mike_Lacey@Cargill.Com<br>

 
No, Thats not it. I want to be able to do this at Design time, not runtime.
 
No I haven't. I'll check it out. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top