473,378 Members | 1,409 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,378 software developers and data experts.

ListView RemoveAt() Argument Out of Range Exception ContextMenu

I have a further question regarding an archive post at:

http://groups-beta.google.com/group/...af0447073a6842

and the error message:

System.ArgumentOutOfRangeException from System.Windows.Forms
Specified argument was out of the range of valid values.
Parameter name: '70' is not a valid value for 'displayIndex'.

The cause appears to be a C# program calling a ListView.RemoveAt()
method from the target method of a ContextMenu on that same ListView.
The exception occurs long after the list view item has been removed and
control returned to the .NET framework.

In the archive post, the answer is written to be:

"You have to post a delayed event and delete it AFTER the click event
has returned."

You may call me simple, but exactly (i.e., code snippets) how do I
"post a delayed event" after "the click event has returned"?

Nov 17 '05 #1
0 1963

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

Similar topics

0
by: Mike Barrett | last post by:
I have a strange one here and I believe it is a bug. I googled it and saw others having a similar issue and nobody seems to have a fix. I will take another shot. I get this ERROR MESSAGE... ...
2
by: VR | last post by:
I have a form with a list view control, a button control and a main menu with menuDelete item. Any time I am handling a button click event or menuDelete click event I call DeleteItem() function...
3
by: Pengyu | last post by:
Whenever I call listView.RemoveAt(listView.Count-1), which remove the last item, I get an out of range exception. How to solve this problem? Thanks a lot, Pengyu.
2
by: Aron Henning | last post by:
I have a ListView that contains the subfoldes of a local drive. Whan i click on a subfolder the listbox should display the subfolders of this folder instead. the funktion is as follows: private...
0
by: Mike Barrett | last post by:
I have a strange one here and I believe it is a bug. I googled it and saw others having a similar issue and nobody seems to have a fix. I will take another shot. I get this ERROR MESSAGE... ...
0
by: sonu | last post by:
Hi all, I have a listview control which has four columns like { Col1, Col2, Col3, Col4}. I add data in listview like this, dim lvitem as listviewItem
0
by: Droopy | last post by:
Hi, I got the System.ArgumentOutOfRangeException exception when adding an item in ListView. This ListView (listViewOutput) is used to display messages to user (normal messages and error...
5
by: Phill W. | last post by:
(VB'2003) What's the correct way to remove multiple, selected items from a ListView control (say, from a ContextMenu)? I ask because I'm getting a very annoying ArgumentOutOfRangeException...
1
by: dvestal | last post by:
I have a ListView with checkboxes. I want to remove items when the checkboxes are unchecked, but to do so yields an ArgumentOutOfRangeException. Is there an easy way to get around this? A...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.