L
L
lPestl2014-01-31 03:59:58
Programming
lPestl, 2014-01-31 03:59:58

How to solve problems with an error when resizing a PictureBox in Visual Studio?

We have a dialog form for working with the camera, where images of frames that change in Timer_tick are displayed in the pictureBox element. Everything works fine, but if you try to resize the window (the size of the pictureBox changes along with it), then an error occurs and the application crashes. The debbager stops at the call line of this dialog box. The error entry in output is as follows:
An unhandled exception of type 'System.ArgumentException' occurred in System.Drawing.dll
Additional information: Invalid parameter.
I tried to stop the timer on the SizeChanged event, but it did not help.
Tell me how this problem can be overcome? If you need a more detailed description with code, I can provide. I didn’t give it right away because a similar error crashes even in the simplest cases in examples with a similar description.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question