Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to populate a listbox
Message
 
To
13/01/2006 15:05:01
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01086295
Message ID:
01086682
Views:
12
>What happens is that the listbox gets populated with 5 items, but they are blank, I can even scroll them. I put a "?this.value" in the click event of the listbox to test and it turns up nothing. What gives?
>
>Something that you did with my example is wrng. I just double checked this: dropped a base class list box on a base class form and copied and pasted the code I posted into the list box's init(). I saw a list box with the following items:
>
>One
>Two
>Three
>Four
>Five
>
>Don't know what you did or where you pasted the code, but obviously you did something different than I did.

I had to add this into the forms LOAD for it to work, did you omit this by accident? (I'm the one who makes accidents around here :) )

thisform.ADDPROPERTY("acontents[1]")

So I dropped your code into the init and PRESTO !!!!
FOR lnI = 1 TO 5
Thisform.aContents[ lnI ] = lnI
ENDFOR

WITH Thisform.List1
.RowSourceType = 5
.RowSource = "Thisform.aContents"
.Requery()
.ListIndex = 1
ENDWITH

PS, what do you mean by array scope?
"Build a man a fire, and he's warm for a day.
Set a man on fire, and he's warm for the rest of his life."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform