About the multi-threading controls

Aug 17, 2009 at 3:55 AM

When I use the Controls it always throw out an exception when the code reaches line 810 in DoubleBufferedControl.cs

if (
                    // If there's no handle, exit
                    // If the control is disposed, exit
                    || IsDisposed
                    // If the width is zero, exit
                    || _Width <= 0
                    // If the height is zero, exit
                    || _Height <= 0
                    // If the control is invisible, exit
                    || !Visible)  <-------- line 810


at Microsoft.AGL.Common.MISC.HandleAr(PAL_ERROR ar)
   at System.Windows.Forms.Control.get_Visible()
   at GeoFramework.Drawing.DoubleBufferedControl.Repaint()
   at GeoFramework.Drawing.DoubleBufferedControl.PaintingThreadProc()

It seems a multi-threading issue.

Is it a problem or just I use this code in a wrong way? If it is a problem, I will try to fix it. If I use the controls wrong, please let me know.

Aug 17, 2009 at 3:56 AM

My environment:

WM 6.5 + CF 3.5 + VS 2008