Hi all, I am still having the same problem, when the control is added dynamically at runtime each time it is needed. I also ensure that it is removed from the main form's controls collection and set to null, before I create the new dialog form.
Any advice at all will be welcomed. Paul Jefferies -----Original Message----- From: Paul Jefferies Sent: 29 May 2002 12:59 To: [EMAIL PROTECTED] Subject: [DOTNET] System.Drawing.dll Exception?? Hi, I have a simple C# winforms app, which uses a control developed by one of my colleagues. This control manages the import of data from a csv file to a database. It declares an interface that the main form implements in order to provide the customization for the actual task of importing the data. The problem I am having is when the import is in progress and is then cancelled (by the use of a button on the control), if I subsequently create another form (e.g. About dialogbox) I get an exception when initializing the form - but only if the form has to create a new System.Drawing.Font (like when a label doesn't have the default font settings). The exception message is : An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll Additional information: Overflow or underflow in the arithmetic operation. Now if the import actually completes, this does not happen. The event to cancel the import just sets a flag that the import routines checks before each line is imported, then the control follows the same code path as if the import reached the end of the input file. I have tried resetting the control back to how it was to begin with - still the same. I am at a loss here as to how to chase this problem down. Any pointers will be greatly appreciated. Has anyone encountered a problem like this before? I know this probably doesn't give you all the info you need, I am more than happy to provide more detail where needed. Regads, Paul Jefferies Adastra Software Ltd www.adastra.co.uk You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.