>Hi,
>
>I have a listbox with the Multiselect option enabled. I want the user to
>be
>able to select multiple items without pressing the CTRL key. When a user
>clicks on an item, it should toggle from an unselected state to selected
>state and vica versa. Is there any way to do that? I tried putting this
>code in the click event of the Listbox without much success.
>
>if this.ListIndex>0
> this.Selected(this.ListIndex) = !this.Selected(this.ListIndex)
>endif
>
>But all this code does is to position the cursor in the listbox to the
>lastitem without doing any multiple selections. I am using VFP 9.0 BTW.

i also tried:

if this.ListIndex>0
this.Selected(this.ListIndex) = !this.Selected(this.ListIndex)
NODEFAULT
endif

but what happens is that as soon as I click on an item, it flashes selected
then deselected.

Re: How to select multiple items from a Listbox without pressing CTRL key? by Gene

Gene
Tue Jun 26 10:36:38 CDT 2007

"Zoom" <keashdoc@hotmail.com> wrote:

>>I have a listbox with the Multiselect option enabled. I want the user to
>>be
>>able to select multiple items without pressing the CTRL key. When a user

It is already possible if the items are consecutive. If they are
not, then <Ctrl> is needed. Doing it another way would be breaking
standards. As a user, I would complain about the broken control.

[snip]

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.

Re: How to select multiple items from a Listbox without pressing CTRL key? by Craig

Craig
Tue Jun 26 11:27:28 CDT 2007

You could add a check box to the listbox. See
http://support.microsoft.com/kb/157048/en-us

--
----
Craig Berntson
MCSD, Visual FoxPro MVP
Salt Lake City Fox User Group
"Zoom" <keashdoc@hotmail.com> wrote in message
news:eJSdnXAPwvffuRzbnZ2dnUVZ_g-dnZ2d@comcast.com...
> >Hi,
>>
>>I have a listbox with the Multiselect option enabled. I want the user to
>>be
>>able to select multiple items without pressing the CTRL key. When a user
>>clicks on an item, it should toggle from an unselected state to selected
>>state and vica versa. Is there any way to do that? I tried putting this
>>code in the click event of the Listbox without much success.
>>
>>if this.ListIndex>0
>> this.Selected(this.ListIndex) = !this.Selected(this.ListIndex)
>>endif
>>
>>But all this code does is to position the cursor in the listbox to the
>>lastitem without doing any multiple selections. I am using VFP 9.0 BTW.
>
> i also tried:
>
> if this.ListIndex>0
> this.Selected(this.ListIndex) = !this.Selected(this.ListIndex)
> NODEFAULT
> endif
>
> but what happens is that as soon as I click on an item, it flashes
> selected then deselected.
>
>
>
>