Quote:
A warning is needed as anyone can right click by accident. So aborting is stupidity, I guess. How shall I implement this? Please help.
We can't - the first thing you have to do is use the debugger to find out exactly what is in the array index, and why it got there. Put a breakpoint on the line throwing the exception, and look at the variables when it gets hit. Think about what you expected to be there, and what you actually got. Why are they different? How did that value get there?
If it's a user error, then check for it, and display an appropriate error using MessageBox. If it isn't, then start back tracking how the value got there, and find out what you need to do to prevent that from happening again.
Sorry, but we can't do that for you!