473,399 Members | 2,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

rather basic ?.. brain dead....

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


May 21 '06 #1
2 1133
"Aussie Rules" <no****@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/534ed1f2a04ac510>

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

May 21 '06 #2
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)

"Aussie Rules" <no****@whocares.com> wrote in message
news:u$**************@TK2MSFTNGP04.phx.gbl...
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


May 21 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: johnchampion | last post by:
hi, my brain is mush right now but i'm trying to remember how to create a php script that opens a text file, appends text to it, then closes it. i just cannot remember this simple task to save...
4
by: Francis Lavoie | last post by:
Hello I have some questions regarding webframework, I must say that I quite lost and these questions are basicly to help me understand the way it work. I have some knowledge with PHP and JSP....
3
by: One Handed Man \( OHM - Terry Burns \) | last post by:
Yes, my brain is once again dead ( this is my mind writing using a supernatural force ). I'm trying to validate an xml file against its schema, I have a very simple example where price is a...
7
by: One Handed Man \( OHM - Terry Burns \) | last post by:
I've been battling with this stupid problem for hours now. WebApp: Trying to do a simple transformation using XSLT to a Web Page, but it just failes without an error message ( In other words,...
3
by: Joachim Klassen | last post by:
Hi all, if I accidentally use a TAKEOVER command with BY FORCE clause while primary and standby are in peer state I'll end up with two primary's (at least with FP10 and Windows). Is this works ...
97
by: Master Programmer | last post by:
An friend insider told me that VB is to be killled off within 18 months. I guess this makes sence now that C# is here. I believe it and am actualy surprised they ever even included it in VS 2003 in...
28
by: Randy Reimers | last post by:
(Hope I'm posting this correctly, otherwise - sorry!, don't know what else to do) I wrote a set of programs "many" years ago, running in a type of basic, called "Thoroughbred Basic", a type of...
14
by: MartinRinehart | last post by:
Working on parser for my language, I see that all classes (Token, Production, Statement, ...) have one thing in common. They all maintain start and stop positions in the source text. So it seems...
1
by: Microsoft Newsserver | last post by:
I know I know the answer to this, but my brain has gone to sleep.... I set up the selected styles for my meny whocjh is in the master page. Unforntuynately, as soon as I put in a navigate URL to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.