Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox unresponsive, then later it starts working
Message
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Vista
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01375836
Message ID:
01391497
Views:
99
>See also Re: Listbox with first seven items enabled Thread #1297487 Message #1297518
>
>>I have a strange bug that I can't figure out.
>>
>>In my form, I have a set of tabbed pages. On one of the pages I have several listboxes. Almost all of the listboxes trigger the InteractiveChange event when I select an item from their lists. But one listbox does not. I have set a breakpoint on the InteractiveChange method, and it doesn't get hit when I click on an item on the list. The listbox enable property is set to .T.
>>
>>The odd thing: If I click on a tab of one other page in the set, and then return to the page that has the problem listbox, the listbox begins working, and will continue to work as long as that form is running.
>>
>>Clicking on that other page alone is the only thing that I have found that causes the problem listbox to work. Clicking on no other tabs, or other controls makes the problem listbox begin working.
>>
>>So, what is it about the other page that fixes the listbox? I don't know. I have tried putting RETURN statements in the Activate and Init methods of that page, but it still fixes the problem listbox.
>>
>>I would appreciate any suggestions on how to debug this problem.
>>
>>Thanks,
>>Jim

A follow-up to my original posting:

Naomi suggested Thread #1297487 Message #1297518 (by Fred Taylor). Other people had reported similar problem.

This appears to be a bug in VFP. (I am always suspicious when I conclude that the problem is in VFP rather than in my own code. But here goes.)

There appears to be some kind of interference between a listbox on one page of a pageframe with a listbox in the same screen position on another page in the same pageframe. My solution: in the Init method of one of the pages, move the listbox off the form, i.e. Left = -1000. In the activate method of that page, move it back to its original position. In the deactivate method of that page, move it back to Left = -1000. I'll refer to the listbox that I'm moving as the "offending" listbox. Problem solved?

Yes, until I added another page to the pageframe and put a listbox in the same place. Problem returned. Only this time, moving the "offending" listbox off the page in the Init and Deactivate methods and back onto the page in the Activate method didn't solve the problem. What did solve the problem was to move the offending listbox out of the way at design time, in the form designer, and also in the deactivate method of the page. Moving it back into position in the page Activate method. Problem solved?

Well, almost. I started wondering how far I had to move the listbox to make the problem go away. If I changed the Left position of the listbox in its container from 22 to 30, the problem went away. Well almost.... what I found was that when I moved the "offending" listbox from left = 22 to 30, and then tested the listbox in the other page, clicking on any of the items in the target list worked as long as I clicked near the left edge of the listbox (maybe the first 5 or 6 characters). If I went further right, it was unresponsive. Move the "offending" listbox a little more to the right makes a more of the right side of the target listbox responsive.

Anyone have any ideas about what is really go on here?

Thanks,
Jim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform