Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox default value
Message
 
To
13/11/2001 13:10:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00580935
Message ID:
00580996
Views:
18
>>>>>>>>Would MyList.ListIndex = 1 work?
>>>>>>>>
>>>>>>>>>I have a listbox which is defaulting to values. The values are some IP addresses such as 1.1.1.1,2.2.2.2,3.3.3.3. At this point, if I run the form, the listbox default value is none. If I open the listbox, I see those three values. However, I would like the listbox to default to the first value. So, I enter 1.1.1.1 in the value property. I don't even run the form. I just save it and when I come back the value is set back to 0. What am I missing?
>>>>>>>
>>>>>>>Yes, that is working. But, would it be a way to have that at the property level? Right now, as this property is read only, I have to do ThisForm.MyListBox.ListIndex=1 in the form Init(). I guess I'm not the only one who need to default a listbox with values to a default value. I'm just wondering if there could be a way to do at the property level.
>>>>>>
>>>>>>
>>>>>>Simply put "1.1.1.1" in the DisplayValue property.
>>>>>
>>>>>Putting a value in that property it not saved.
>>>>
>>>>Try ="1.1.1.1" to convert the value to string.
>>>
>>>That does not get saved either.
>>
>>Weird....
>>
>>I try and got the same result than you.
>>But i am sure i use this property to set values in the past,
>>may be it is with version 5 or 3?
>>
>>Anyway, if you put 1 in the value property
>>the list show the first value.
>
>Putting 1 in that property does not get saved either. :)

At this point, i think you should reverse your smily to :(

In my tests putting 1 in either displayvalue or value
show the first list element when the form was display...

May be you have played to far with the setting of this listbox?

:-) HTH
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform