Re: Cannot multiselect programmatically?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I am just using the semicolon to separate the items in the list (and to end
the list), I could have used a comma but that character actually appears in
a few of the list items. I was using rowsourcetype = 6 and the
thisform.l_cListing was used to hold the subset of the whole list that I
wanted to have preselected automatically.

Rich


"Anders" <anders@anders> wrote in message
news:uIg1xIUvFHA.3860@xxxxxxxxxxxxxxxxxxxxxxx
> Why would your list items end with semicolon (;)? RowSourceType=1 is a
> comma-delimitd list but the comma is not part of the list value.
>
> -Anders
>
> "Rich" <richhennessy@xxxxxxxxxxxxxx> skrev i meddelandet
> news:u5SVIATvFHA.908@xxxxxxxxxxxxxxxxxxxxxxx
>> Hi,
>>
>> I have a list box control on a form that is bound to records in a single
>> column table. I have multiselect turned on and I want to have some of
>> the
>> items in the listbox already selected by default when the form is loaded.
>> I have tried to set the selected() property of the listbox but this does
>> not
>> work for some reason. But the users can select multiple items and it
>> does
>> work. How do I programmatically select multiple items in the list?
>>
>> Here is my code below. This code is in the init of the form and it has
>> no
>> effect on the list except that it results in the list being at the eof().
>>
>> The This.l_clisting property holds a list of the items to be preselected.
>>
>> With This.lstOptions
>> For i = 1 To .ListCount
>> If Alltrim(.List(i)) + ";" $ This.l_cListing
>> .Selected(i) = True
>> Endif
>> Next i
>> Endwith
>>
>>
>> Any help would be greatly appreciated. My code does not work in 6, 7 or
>> 8
>> of VFP.
>>
>> Thanks,
>>
>> Rich
>>
>>
>>
>
>


.



Relevant Pages

  • Helpful hint
    ... Set listbox Sorted property to True ... Change the semicolon after the old last unit to a comma ... & direct edits to the project source often broke the ...
    (comp.lang.pascal.delphi.misc)
  • Re: Cannot multiselect programmatically?
    ... Why would your list items end with semicolon? ... comma-delimitd list but the comma is not part of the list value. ... > items in the listbox already selected by default when the form is loaded. ... How do I programmatically select multiple items in the list? ...
    (microsoft.public.fox.programmer.exchange)
  • Re: American semicolons
    ... claim that Americans 'only use ";" to separate two things that would ... semicolon can be a strong comma as well as weak period. ...
    (alt.usage.english)
  • Re: Macro crashing on different computer
    ... >ConsecutiveDelimiter, Tab, Semicolon, Comma, Space, ... >FieldInfo, DecimalSeparator, ThousandsSeparator) ...
    (microsoft.public.excel.programming)
  • Re: Find and Replace with Wildcards
    ... This starts with a semicolon, finds everything but a semicolon and comma up ... A peer in "peer to peer" support ... > I turned wildcards on and did a find and replace using the following> values for starters: ...
    (microsoft.public.word.docmanagement)