
Signature
Semper Fidelis
Adam Klobukowski
atari@gabo.pl
> I have a scrollable System.Windows.Forms.Panel, and I add/remove
> controls (ListView only) to/from it programatically.
[quoted text clipped - 3 lines]
> saying "invalid parameter used" but no exceprion is thrown. It happens
> randomly, I cannot reproduce steps to achieve it.
None of the methods of the .NET Framework classes display any message box
unless you explicitely ask them to. So you must have some code somewhere
that catches some (or all) of the exceptions and displays a message box
with the exception message instead of letting the exception bubble up. Find
this code and remove that so that you can trace where the problem comes
from.
Or are you talking about Visual Studio's unhandled exception dialog box
that pops up automatically whenever an unhandled exception occurs in your
code? In this case, run your application in Debug mode and when this dialog
box pops up, click the Break button to break into your code. From there,
you'll be able to examine your stack trace and the state of your objects to
determine why the exception has been thrown.
In any case, you can always configure Visual Studio to break into your code
whenever an exception (handled or not) is thrown by going to: Debug menu ->
Exceptions -> Common Language Runtime Exceptions -> When an exception is
thrown: break into the debugger.
Adam Klobukowski - 15 Mar 2006 09:13 GMT
Mehdi napisał(a):
>> I have a scrollable System.Windows.Forms.Panel, and I add/remove
>> controls (ListView only) to/from it programatically.
[quoted text clipped - 22 lines]
> Exceptions -> Common Language Runtime Exceptions -> When an exception is
> thrown: break into the debugger.
The problem is I'm 100% sure that not my code is displaying it - the
strange thing in it is that text in message box is bold. I do not
remember any standart .NET messagebox being able to output bold text.
Moreover, there are 3 MessageBox.Show calls around that code, but all of
them display fixed text.
I know I can catch any exception, but the problem is that it happens
really randomly and when I try to trigger it it just does not happen.

Signature
Semper Fidelis
Adam Klobukowski
atari@gabo.pl