Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
UltraToolbarsDockArea exception: Parameter is not valid.
posted

Hello,

I am using the latest 2020.1 components in a winforms application on a windows 10 machine.

When I close a form, some callback is triggered which as far as I can tell is/was not set up by my code that causes the 'parameter is not valid' exception.  What is strange is this is not consistently reproducible.  Opening the app fresh and performing the exact same steps multiple times results in this exception maybe 1/4 times.

I cannot provide the source because the solution is proprietary and far to large to share, however from the stack trace, none of my code is involved so I'm not sure that my code would help in any way:

at System.Drawing.Image.get_Width()
at System.Drawing.Image.get_Size()
at Infragistics.Win.ImageAndTextUIElement.PositionChildElements()
at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean clipText, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics, Nullable`1 zoomFactor)
at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize, Boolean preventAlphaBlendGraphics)
at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode)
at Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe)
at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

When this exception happens, all my tools (file menu and quicklaunch toolbars) are replaced with a giant red 'X'.

If this is a bug in the components, is there a way to work around this?

Parents
  • 1500
    Offline posted

    Hello

    Red crosses are generally issues with threading, as they occur during the paint event of the controls. It is most common for them to be accompanied by a null reference exception.

    Parameter is not valid usually comes from a bitmap that is 0 bytes, so my best guess is that you have an empty image you try to set at this point, but since its on another thread, most of the time the operation is concluded and there is no exception, while at more load heavy times it will trigger.

    Alternatively, you might be disposing of the object too soon, which will result in the same exception.

    While this is the common case, it is possible that there can be an issue within our controls and in order to test and investigate, we need at least steps to reproduce this to test it on our end.

    Sincerely,
    Tihomir Tonev
    Associate Software Developer
    Infragistics

Reply Children