Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / VB.NET / May 2006

Tip: Looking for answers? Try searching our database.

rather basic ?.. brain dead....

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Aussie Rules - 20 May 2006 19:21 GMT
Hi,

i have a list box with a number of items.

I want the user to be able to select a number of items, press the delete
key, and they are delete. The following code does cause an error....

I guess i must be doing it wrong, but can't think how else to go about the
delete (after trapping the delete keydown)

----
Dim indx As clsInspectionTime

For Each indx In lstInspectiontimes.SelectedItems

lstInspectiontimes.Items.Remove(indx)

Next
Herfried K. Wagner [MVP] - 20 May 2006 19:48 GMT
"Aussie Rules" <nobody@whocares.com> schrieb:
> I want the user to be able to select a number of items, press the delete
> key, and they are delete.

See:

<URL:http://groups.google.de/group/microsoft.public.dotnet.languages.vb/msg/534ed1f2a
04ac510
>

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>

Brian Henry - 20 May 2006 21:10 GMT
when enumerating a collection, you can not change the enumeration... aka you
cant remove items from it... so you will have to use the .count property of
the selected items collection and move through them one by one until there
is zero items in it... (this is not enumerating, only for each is)

> Hi,
>
[quoted text clipped - 14 lines]
>
> Next

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.