Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox This.Value loses value in Class
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00264745
Message ID:
00272329
Views:
22
>Terry,
>
>Your problem is different. Many people assume that because they set the name property of the form object to be MyForm that that will become the variable that references the form. That's not always true as VFP has to insure that the variable that references the fomr is unique so it may not be MyForm.

You're correct about my issues. I think ListBox has behavioral problems! I added some Drag n Drop references, noteing this piece of the project includes a timer and a Inet Transfer Control.

When I went in a reset this.parent to thisform, the code I used to validate an item in listbox :
myform.mylist.value=MyString && Knowing that case and length matched
Actually showed a listindex > 0 a couple of times.
But eventually I had to recurse and double assign:

Myform.Mylist.ListIndex=Myform.MyList.ListIndex
for Myform.Mylist.ListIndex = 1 to Myform.Mylist.ListCount
if MyForm.Mylist.ListItem(MyForm.Mylist.ListIndex)=MyString
Myform.MyList.Value=MyString
Myform.Mylist.ListIndex=Myform.Mylist.ListIndex
exit
Endif
Endfor.

A little overkill - I wish I knew how to get an honest ListIndex (programatically) using the Value to force the index. Maybe I've missed some case conversions, but it seems that the method, if too fast, will just shoot on by.

Terry
Imagination is more important than knowledge
Previous
Reply
Map
View

Click here to load this message in the networking platform