ListView RemoveAt() Argument Out of Range Exception ContextMenu

  • Thread starter Thread starter Bill Johnson
  • Start date Start date
B

Bill Johnson

I have a further question regarding an archive post at:

http://groups-beta.google.com/group...3349b8bf19d,d79c7c14342df130,34af0447073a6842

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"?
 
Back
Top