Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox woes
Message
From
19/06/2001 14:30:27
Patrick O'Neil
American Specialty Information Services
Roanoke, Indiana, United States
 
 
To
12/06/2001 05:37:14
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00457316
Message ID:
00521177
Views:
20
>>Okay, I think I've narrowed down the problem, but I still can't solve it. My listbox loads properly with data from my table. I select multiple items and all is well. But if I deactivate and re-activate the form (i.e. by selecting another form and returning to the first one), the previously selected items in my listbox are no longer selected. How can I keep the items selected?
>
>Elyse,
>With rowsource fields record pointer follows table. You would have to individually set each selected(itemid)=.T. AND you wouldn't set focus to listbox. When user sets focus to listbox by any means (click, tab etc) he loses the selections. A workaround is to not usng a listbox but a grid. See MultiselectGrid here in downloads section or an enhanced version at www.foxyclasses.com . With grid all you need to set if a field flag.
>Cetin
whenever it seems that there is no better place for code
than in the activate, but you don't want that code executed
every time the activate event fires, just use a form-level
variable to control it ...

first_time_activated = .T.   (user define form property , set at design time)

(in activate method):

if ( first_time_activated )
  first_time_activated = .F.
  ... your "one-time-only" code here ...
endif
patrick
Previous
Reply
Map
View

Click here to load this message in the networking platform