Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Listbox with pre-selected checkboxes?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01136236
Message ID:
01136395
Views:
11
Hello Sergey,

The grid would work but there are two problems (in my tiny mind) with it in this scenario.

1) The design of this form is generic so that you can use the form with any table. The grid scenario requires that each table have a "selected" field that the checkbox can tie to. (None of our tables do) This means that I would have to do something along the lines of creating a matching cursor that had the extra column and appending all the data from the original table.
2) The form I'm designing is flexible enough that I can pass either a table/field (mcategor.desc) or a comma seperated list (One,Two,Three,Four). Here again, if I try to do the comma seperated list, I'd have to build a cursor, loop through the cs list and insert records for each item in the list.

Neither of those are biggies, but the listbox doesn't require all of the conversions mentioned above. The only thing the listbox isn't doing at this point is allowing me to manipulate the picture of each item in the forms' Init when the listbox has a rowsource of 6.

If there is no way to get the listbox to work, I may have to make the switch to the grid method.

Thanks for making me aware of the possibility at least!

>Hi Rodd,
>
>I prefer to use multiselect grid from chapter 6.9 of KiloFox.
>
>
>>I'm creating a generic form that can be used to present a list to a user. The form uses a listbox with check boxes (many thanks to the "1001 Things ... " team).
>>
>>One of the parameters passed to the form is the RowSource to be used. In the Init, I set the rowsource for the listbox. This part works great!
>>
>>However, I want to be able to pre-check some of the items in the list. So, I'm allowing the user to pass a comma-delimited list of items as a parameter to the form. I then run the following code in the form's Init:
><snip>
>>
>>If I add a button to the form and have the click event call this._PreSelect, everything works great. Also, the call to _PreSelect does indeed find the matches and set the selected flag in my array. However, setting the picture during Init does not seem to have any affect.
>>
>>Is there any way to get the listbox to accept different pictures during the form's init? If not, how can I "pre-check" those particular items?
>>
>>Thanks for your help!
Previous
Reply
Map
View

Click here to load this message in the networking platform