Re: Programatically - Listbox

Mysoresrikantaiah Srinivasaprasad <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.general
Message-ID <[email protected]>
use this way

objList.Items[i].Selected = true

you can loop through to select multiple items


Srinivasa Prasad



                      Wayne Lee
                      <wayne.lee@BLUEYO        To:       [email protected]
                      NDER.CO.UK>              cc:
                      Sent by: The             Subject:  Re: [DOTNET] Programatically - Listbox
                      DOTNET list will
                      be retired 7/1/02
                      <[email protected]
                      EVELOP.COM>


                      06/17/2002 05:07
                      PM
                      Please respond to
                      The DOTNET list
                      will be retired
                      7/1/02





Damn, the selected property is readonly on the dropdown...didn't think
to check for the listbox!

Thanks Chris/merak!

Wayne Lee
This email has been scanned with Norton AntiVirus 2002


-----Original Message-----
From: The DOTNET list will be retired 7/1/02
[mailto:[email protected]] On Behalf Of Chris Anderson
Sent: 17 June 2002 12:05
To: [email protected]
Subject: Re: [DOTNET] Programatically - Listbox


Use the list items Selected property, instead of the ListBox's
SelectedIndex property

Merak

> -----Original Message-----
> From: Wayne Lee [mailto:[email protected]]
> Sent: 17 June 2002 12:00
> To: [email protected]
> Subject: [DOTNET] Programatically - Listbox
>
>
> Hi All,
>
> I have 4 entries in a listbox, when I query the database i return a
> datareader which i then use to loop through. I then want each item in
> the listbox to be selected if it exists in the record.
>
> how can I programatically select more than one item in the listbox? i
> can loop through ok and get it to set the selected index property but
> this is only a single entry and not a recursive list.
>
> any ideas please?
>
> many thanks

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.